You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code is attempting to reallocate memory for the p_j2k pointer using the opj_realloc function. If the allocation is successful, then the opj_realloc call will free the old memory pointed to by p_j2k. However, the subsequent opj_free call will attempt to free the same memory that was just freed by opj_realloc. This will result in a double free vulnerability, as the memory will be freed twice and will no longer be accessible.
To fix this bug, the opj_free call should verify that p_j2k isn't null before freeing it again.
The text was updated successfully, but these errors were encountered:
If the allocation is successful, then the opj_realloc call will free the old memory pointed to by p_j2k
yes
However, the subsequent opj_free call will attempt to free the same memory that was just freed by opj_realloc.
Wrong... The opj_free() is only called if new_header_tile_data == NULL, that is if the realloc failed
This will result in a double free vulnerability, as the memory will be freed twice and will no longer be accessible.
No
To fix this bug, the opj_free call should verify that p_j2k isn't null before freeing it again.
No again. p_j2k is already dereferenced before this piece of code, and has nothing to do with a potential double-free.
Please study C a bit more before creating false positive issues... Reports about vulnerabilities are more convincing when accompanied with a reproducer
Hi, If I'm not wrong there might be a potential double-free vulnerability in openjpeg/src/lib/openjp2/j2k.c
The code is attempting to reallocate memory for the p_j2k pointer using the opj_realloc function. If the allocation is successful, then the opj_realloc call will free the old memory pointed to by p_j2k. However, the subsequent opj_free call will attempt to free the same memory that was just freed by opj_realloc. This will result in a double free vulnerability, as the memory will be freed twice and will no longer be accessible.
To fix this bug, the opj_free call should verify that p_j2k isn't null before freeing it again.
The text was updated successfully, but these errors were encountered: