0006-src-aiff.c-Fix-a-buffer-read-overflow.patch 1.0 KB

1234567891011121314151617181920212223242526272829
  1. From f833c53cb596e9e1792949f762e0b33661822748 Mon Sep 17 00:00:00 2001
  2. From: Erik de Castro Lopo <erikd@mega-nerd.com>
  3. Date: Tue, 23 May 2017 20:15:24 +1000
  4. Subject: [PATCH] src/aiff.c: Fix a buffer read overflow
  5. Secunia Advisory SA76717.
  6. Found by: Laurent Delosieres, Secunia Research at Flexera Software
  7. Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
  8. [Retrieved from:
  9. https://github.com/erikd/libsndfile/commit/f833c53cb596e9e1792949f762e0b33661822748]
  10. ---
  11. src/aiff.c | 2 +-
  12. 1 file changed, 1 insertion(+), 1 deletion(-)
  13. diff --git a/src/aiff.c b/src/aiff.c
  14. index 5b5f9f53..45864b76 100644
  15. --- a/src/aiff.c
  16. +++ b/src/aiff.c
  17. @@ -1759,7 +1759,7 @@ aiff_read_chanmap (SF_PRIVATE * psf, unsigned dword)
  18. psf_binheader_readf (psf, "j", dword - bytesread) ;
  19. if (map_info->channel_map != NULL)
  20. - { size_t chanmap_size = psf->sf.channels * sizeof (psf->channel_map [0]) ;
  21. + { size_t chanmap_size = SF_MIN (psf->sf.channels, layout_tag & 0xffff) * sizeof (psf->channel_map [0]) ;
  22. free (psf->channel_map) ;