diff options
author | Marcus Meissner <marcus@jet.franken.de> | 2022-11-21 16:44:39 +0100 |
---|---|---|
committer | Marcus Meissner <marcus@jet.franken.de> | 2022-11-21 16:44:39 +0100 |
commit | 4ec4da6ed67a58369e0bb45ce172f1618b75eb18 (patch) | |
tree | 68bdeeae64d2830049664e30c2749e371d1204e6 | |
parent | dae0ec028d6bbf649ae3cce69ecad9986d7ace33 (diff) | |
download | libgphoto2-4ec4da6ed67a58369e0bb45ce172f1618b75eb18.tar.gz |
convert a malloc(w*h) to calloc(w,h) to avoid overflow issues, found by codeql
-rw-r--r-- | camlibs/jl2005a/library.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/camlibs/jl2005a/library.c b/camlibs/jl2005a/library.c index 23a20bb8e..867145314 100644 --- a/camlibs/jl2005a/library.c +++ b/camlibs/jl2005a/library.c @@ -243,7 +243,7 @@ get_file_func (CameraFilesystem *fs, const char *folder, const char *filename, status = GP_ERROR_CORRUPTED_DATA; goto end; } - p_data = malloc( w*h ); + p_data = calloc( w,h ); if (!p_data) { status = GP_ERROR_NO_MEMORY; goto end; |