a[i] = v past a read-only length grows the array instead of failing
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
- 79/100
- Tipo de issue
- Error
- Claridad
- Bien especificado
- Estado de actividad
- Activo
- Stack tecnológico
- c, javascript
Línea de trabajo
Empieza en quickjs.c, en la ruta rápida inline de OP_put_array_el (alrededor de las líneas 20164–20171), y luego compara cómo se gestiona la longitud con add_fast_array_element y JS_SetPropertyValue. Comprueba el comportamiento de la asignación a arrays tanto en modo sloppy como en modo strict cuando length no se puede escribir. El objetivo se cumple cuando la longitud del array sigue siendo 2 en modo sloppy y el modo strict lanza TypeError.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
With a non-writable length, assigning past the end grows the array in the inline fast path.
const a = [0, 0, 0, 0];
a.length = 2;
Object.defineProperty(a, "length", { writable: false });
a[2] = "x";
console.log(a.length);
Expected: 2 (sloppy mode; strict mode throws TypeError)
Actual (observed): 3
Spec: Array [[DefineOwnProperty]]: an index >= length with length not writable returns false.
Version: quickjs-ng master, revision not recorded in the test build (source read at a36054a). Built with the quickjs-ng on our build host.
Fix note: the inline path of OP_put_array_el (quickjs.c:20164-20171) writes length without a JS_PROP_WRITABLE check. add_fast_array_element (:10674) and JS_SetPropertyValue (:11028) do check it.
Related: #1882 (same class, different site).
We found this while fuzzing.
Credit: https://ucsbplse.github.io/
- Lenguaje dominante
- C
- Estrellas
- 3.9k
- Forks
- 389
- Merge medio
- 2 d 2 h
- PR fusionados (30 d)
- 21
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: 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 quickjs-ng/quickjs
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
quickjs-ng/quickjs#1972 ·
Los mantenedores suelen responder en 1 día
-
Reflect.defineProperty on a typed array returns false instead of propagating conversion errorsAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
quickjs-ng/quickjs#1971 ·
Los mantenedores suelen responder en 1 día
-
`JS_ToCStringLen2` leaks the string when the UTF-8 buffer allocation failsPosiblemente ocupada @bnoordhuis la tomó hace 1 día. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quickjs-ng/quickjs#1965 ·
Los mantenedores suelen responder en 1 día
-
JS_SetPropertyInternal2 loses the value when a lazy property on the prototype runs out of memoryPosiblemente ocupada @TheNetherWatcher la tomó hace 11 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
quickjs-ng/quickjs#1852 ·
Los mantenedores suelen responder en 1 día
-
Object.prototype.propertyIsEnumerable converts `this` before the property keyPosiblemente ocupada @SomSamantray la tomó hace 52 días. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
quickjs-ng/quickjs#1772 ·
Los mantenedores suelen responder en 1 día
Todos los issues de quickjs-ng/quickjs
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
fastfetch-cli/fastfetch#2780 ·
Los mantenedores suelen responder en 1 día
-
enhancement
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
elliotchance/vsql#2079 ·
Los mantenedores suelen responder en 1 día
-
[libcbor] update to 0.15.1Abiertocategory:port-update
Dificultad 2/5 1-3 horas Aptitud para principiantes 64/100
Los mantenedores suelen responder en 2 días
-
docs
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 61/100
vim/vim#22107 · 1 comentario ·
Los mantenedores suelen responder en 13 días