P2: abort-rearm on a ship that is not being rearmed reads past the object array
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 76/100
Línea de trabajo
Lee sexp_abort_rearm en sexp.cpp y compara cómo busca la nave de apoyo con el helper ai_abort_rearm_request existente en aicode.cpp. El issue describe tres posibles soluciones; comprueba el comportamiento del helper y las pruebas de rearmado pertinentes antes de elegir un enfoque. El trabajo estará terminado cuando abort-rearm no haga nada de forma segura si ninguna nave de apoyo está atendiendo a la nave indicada.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Problem
The abort-rearm sexp crashes or corrupts memory when the ship it names is not currently being rearmed. Mission designers may reasonably use it to cancel a rearm "just in case", but if no support ship is servicing that ship, the sexp hands the repair code an object at index -1 and the repair code reads through it.
In sexp_abort_rearm (sexp.cpp), the support ship is looked up from the ship's AI info without checking that one is set, so &Objects[-1] is passed to ai_do_objects_repairing_stuff, which then walks that object's docking list.
Steps to reproduce
- FSO master (tested on 12a36dc1a with an ASan debug build;
sexp.cpp,aicode.cppandobjectdock.cppare unchanged on current master 76219fd1e), Linux, MediaVPs 5.0.2. - Any mission with a ship that is not being rearmed (I used a GTF Myrmidon given a play-dead order).
- Run
( abort-rearm "<that ship>" )from an event.
Expected vs. actual behavior
Expected: nothing happens, since there is no rearm to abort.
Actual: AddressSanitizer reports a global-buffer-overflow read in dock_find_instance (objectdock.cpp:1047), called from ai_do_objects_repairing_stuff (aicode.cpp:11378) and sexp_abort_rearm (sexp.cpp:15342). The address read is the slot just before the global object array. Without the sanitizer the result depends on whatever memory sits there.
Proposed fixes
- Skip ships with no support ship. In
sexp_abort_rearm, continue to the next ship whensupport_ship_objnumis negative. One line, matches what the sexp promises. - Guard inside the repair function. Have
ai_do_objects_repairing_stuffignore an abort when the repair object is invalid, which also protects any other caller. - Route through the existing abort helper. Call
ai_abort_rearm_request, which already handles the "nobody is servicing me" case, instead of calling the repair code directly.
- Lenguaje dominante
- C++
- Estrellas
- 488
- Forks
- 184
- Merge medio
- 2 d 9 h
- PR fusionados (30 d)
- 40
Preparar el entorno
Aún no hemos revisado los archivos de configuración de este proyecto. Empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de scp-fs2open/fs2open.github.com
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 83/100
scp-fs2open/fs2open.github.com#7918 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
scp-fs2open/fs2open.github.com#7916 ·
Los mantenedores suelen responder en 1 día
-
P2: A timed rotation maneuver does nothing on a ship that had an earlier timed lateral maneuverPosiblemente ocupada @vovosta la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
scp-fs2open/fs2open.github.com#7914 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
scp-fs2open/fs2open.github.com#7901 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 88/100
scp-fs2open/fs2open.github.com#7899 ·
Los mantenedores suelen responder en 1 día
Todos los issues de scp-fs2open/fs2open.github.com
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
NVIDIA-Omniverse/usd-brep#23 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
qbittorrent/qBittorrent#25121 ·
Los mantenedores suelen responder en 2 días
-
SVT-AV1: Unnecessary size paddingPosiblemente ocupada @pszemus la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
strukturag/libheif#1945 ·
Los mantenedores suelen responder en 1 día
-
v9.6.0: CMake incorrectly enforces presence of libevdevPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 65/100
mltframework/shotcut#1943 ·
Los mantenedores suelen responder en 1 día