Null dereferencing of a pointer in initconfig.c
Los mantenedores suelen responder en 1 día
@lazerg ya está trabajando en esto.
Desde el 30/10/2026.
Evaluación
- Dificultad
- 2/5
- Tiempo estimado
- 1-3 horas
- Aptitud para principiantes
- 72/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Área
- api, backend-api-design
Línea de trabajo
Empieza por las dos ubicaciones enlazadas en Python/initconfig.c y compara el tratamiento de los valores NULL con el caso PyConfig_MEMBER_WSTR_OPT. Consulta la documentación de la C API en Doc/c-api/init_config.rst y verifica después que el comportamiento se ajusta a su contrato y que pasan las pruebas de configuración pertinentes.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Bug report
Potentially, if "value" equals NULL and "spec->type" equals "PyConfig_MEMBER_WSTR_OPT", null will be passed into "utf8_to_wstr" function and might cause a segmentation fault in strlen
https://github.com/python/cpython/blob/d3a1e7280bd74a16c5822cff9c77fa28da4d725e/Python/initconfig.c#L4369-L4376
https://github.com/python/cpython/blob/d3a1e7280bd74a16c5822cff9c77fa28da4d725e/Python/initconfig.c#L4324-L4328
Documentation states that "value" is a null-terminated UTF-8 string, but isn't clearly stating that Null is allowed
Suggested fix: separate "value" and "spec->type" checks
if (value == NULL) {
if (spec->type != PyConfig_MEMBER_WSTR_OPT) {
nitconfig_set_error(config, "config option string cannot be NULL");
return -1;
}
wchar_t **member = raw_member;
free(*member);
*member = wstr;
return 0;
}
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
- Lenguaje dominante
- Python
- Estrellas
- 77.8k
- Forks
- 37.7k
- Merge medio
- 17 h 24 min
- PR fusionados (30 d)
- 716
Preparar el entorno
Inicia el contenedor de desarrollo del proyecto en tu navegador, con tu propia cuenta de GitHub.
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
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 python/cpython
-
build OS-unsupported OS-windows type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 60/100
Los mantenedores suelen responder en 1 día
-
What's New in 3.12 credits the unstable C API tier to PEP 697 instead of PEP 689Posiblemente ocupada @TheLouisMahdi la tomó hace 1 día. Abiertodocs
Dificultad 1/5 Menos de una hora Aptitud para principiantes 82/100
python/cpython#161078 · 3 comentarios ·
Los mantenedores suelen responder en 1 día
-
OS-windows type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
python/cpython#161007 · 4 comentarios ·
Los mantenedores suelen responder en 1 día
-
tests topic-profiling type-bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
python/cpython#160881 · 1 comentario ·
Los mantenedores suelen responder en 1 día
Todos los issues de python/cpython
Issues similares
-
cost:cheap practicality:seen-in-the-wild severity:medium
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
fairagro/m4.2_advanced_middleware_api#620 ·
Los mantenedores suelen responder en 1 día
-
area:security effort:S priority:P2 provider:local-libvirt status:ready type:docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
randomparity/kdive#3495 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
microsoft/markitdown#2820 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 2 días