Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NULL pointer dereference in the stb_image.h #1452

Open
0xdd96 opened this issue Feb 21, 2023 · 1 comment
Open

NULL pointer dereference in the stb_image.h #1452

0xdd96 opened this issue Feb 21, 2023 · 1 comment

Comments

@0xdd96
Copy link

0xdd96 commented Feb 21, 2023

I discovered a null pointer dereference vulnerability in the stb_image.h of libsixel, which also exists in this project.

Specifically, if the stbi__pic_load_core function returns 0 (line 6528), result will be released (line 6529) and set to 0 (line 6530). This null pointer will be dereferenced in stbi__convert_format, which would crash the application.

stb/stb_image.h

Lines 6523 to 6535 in 5736b15

// intermediate buffer is RGBA
result = (stbi_uc *) stbi__malloc_mad3(x, y, 4, 0);
if (!result) return stbi__errpuc("outofmem", "Out of memory");
memset(result, 0xff, x*y*4);
if (!stbi__pic_load_core(s,x,y,comp, result)) {
STBI_FREE(result);
result=0;
}
*px = x;
*py = y;
if (req_comp == 0) req_comp = *comp;
result=stbi__convert_format(result,4,req_comp,x,y);

sezero added a commit to libsdl-org/SDL_image that referenced this issue Feb 25, 2023
sezero added a commit to libsdl-org/SDL_image that referenced this issue Feb 25, 2023
U2FsdGVkX1 pushed a commit to fedora-riscv/usd that referenced this issue Aug 12, 2023
Ensure we have a fix for null pointer dereference bug
nothings/stb#1452.
U2FsdGVkX1 pushed a commit to fedora-riscv/usd that referenced this issue Aug 12, 2023
Ensure we have a fix for null pointer dereference bug
nothings/stb#1452.
U2FsdGVkX1 pushed a commit to fedora-riscv/stb that referenced this issue Aug 12, 2023
U2FsdGVkX1 pushed a commit to fedora-riscv/stb that referenced this issue Aug 12, 2023
U2FsdGVkX1 pushed a commit to fedora-riscv/stb that referenced this issue Aug 12, 2023
U2FsdGVkX1 pushed a commit to fedora-riscv/stb that referenced this issue Aug 12, 2023
U2FsdGVkX1 pushed a commit to fedora-riscv/stb that referenced this issue Aug 12, 2023
@NBickford-NV
Copy link
Contributor

Tracking CVE numbers: this is https://nvd.nist.gov/vuln/detail/CVE-2023-43898 ((#1521), and its equivalent in Servo's Rust port is https://rustsec.org/advisories/RUSTSEC-2023-0021.html.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants