src/libFLAC/stream_decoder.c : Fix buffer read overflow. 54/211254/1 accepted/tizen_5.5_unified accepted/tizen_5.5_unified_mobile_hotfix accepted/tizen_5.5_unified_wearable_hotfix accepted/tizen_6.0_unified accepted/tizen_6.0_unified_hotfix accepted/tizen_6.5_unified accepted/tizen_7.0_unified accepted/tizen_7.0_unified_hotfix accepted/tizen_8.0_unified accepted/tizen_9.0_unified accepted/tizen_unified tizen tizen_5.5 tizen_5.5_mobile_hotfix tizen_5.5_tv tizen_5.5_wearable_hotfix tizen_6.0 tizen_6.0_hotfix tizen_6.5 tizen_7.0 tizen_7.0_hotfix tizen_8.0 tizen_9.0 accepted/tizen/5.5/unified/20191031.005857 accepted/tizen/5.5/unified/mobile/hotfix/20201027.063012 accepted/tizen/5.5/unified/wearable/hotfix/20201027.102945 accepted/tizen/6.0/unified/20201030.105240 accepted/tizen/6.0/unified/hotfix/20201103.000306 accepted/tizen/6.5/unified/20211029.012706 accepted/tizen/7.0/unified/20221110.063521 accepted/tizen/7.0/unified/hotfix/20221116.110750 accepted/tizen/8.0/unified/20231005.094837 accepted/tizen/9.0/unified/20241031.000044 accepted/tizen/unified/20190806.072147 submit/tizen/20190805.090659 submit/tizen_5.5/20191031.000006 submit/tizen_5.5_mobile_hotfix/20201026.185106 submit/tizen_5.5_wearable_hotfix/20201026.184306 submit/tizen_6.0/20201029.205501 submit/tizen_6.0_hotfix/20201102.192901 submit/tizen_6.0_hotfix/20201103.115101 submit/tizen_6.5/20211028.163401 tizen_5.5.m2_release tizen_6.0.m2_release tizen_6.5.m2_release tizen_7.0_m2_release tizen_8.0_m2_release tizen_9.0_m2_release
authorErik de Castro Lopo <erikd@mega-nerd.com>
Tue, 18 Nov 2014 15:20:25 +0000 (07:20 -0800)
committerSeungbae Shin <seungbae.shin@samsung.com>
Wed, 31 Jul 2019 11:46:10 +0000 (20:46 +0900)
This is CVE-2014-8962.

Reported-by: Michele Spagnuolo,
             Google Security Team <mikispag@google.com>

https://git.xiph.org/?p=flac.git;a=commit;h=5b3033a2b355068c11fe637e14ac742d273f076e

Change-Id: Ic9d1d567bd31323a6a9fce92e4acb0d1b60ce14e

src/libFLAC/stream_decoder.c

index f987c27..6bc6407 100644 (file)
@@ -71,7 +71,7 @@ FLAC_API int FLAC_API_SUPPORTS_OGG_FLAC =
  *
  ***********************************************************************/
 
-static FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' };
+static const FLAC__byte ID3V2_TAG_[3] = { 'I', 'D', '3' };
 
 /***********************************************************************
  *
@@ -1365,6 +1365,10 @@ FLAC__bool find_metadata_(FLAC__StreamDecoder *decoder)
                        id = 0;
                        continue;
                }
+
+               if(id >= 3)
+                       return false;
+
                if(x == ID3V2_TAG_[id]) {
                        id++;
                        i = 0;