[vlc-commits] [Git][videolan/vlc][master] png: fix potential buffer overflow

Steve Lhomme (@robUx4) gitlab at videolan.org
Wed Oct 11 12:32:30 UTC 2023



Steve Lhomme pushed to branch master at VideoLAN / VLC


Commits:
59894f24 by Steve Lhomme at 2023-10-11T11:56:36+00:00
png: fix potential buffer overflow

This is the error we have:
../../../modules/codec/png.c:162:49: warning: '%zu' directive output may be truncated writing between 1 and 20 bytes into a region of size between 18 and 37 [-Wformat-truncation=]
  162 |                   "block size %zu too small for %zu encoded bytes",
      |                                                 ^~~
../../../modules/codec/png.c:162:19: note: directive argument in the range [1, 18446744073709551615]
  162 |                   "block size %zu too small for %zu encoded bytes",

- - - - -


1 changed file:

- modules/codec/png.c


Changes:

=====================================
modules/codec/png.c
=====================================
@@ -165,7 +165,7 @@ static void user_write( png_structp p_png, png_bytep data, png_size_t i_length )
 {
     block_t *p_block = (block_t *)png_get_io_ptr( p_png );
     if( i_length > p_block->i_buffer ) {
-        char err_str[64];
+        char err_str[128];
         snprintf( err_str, sizeof(err_str),
                   "block size %zu too small for %zu encoded bytes",
                   p_block->i_buffer, i_length );



View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/59894f24f431e717444bb49331f35624eedc64f7

-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/59894f24f431e717444bb49331f35624eedc64f7
You're receiving this email because of your account on code.videolan.org.


VideoLAN code repository instance


More information about the vlc-commits mailing list