platform/upstream/libsndfile.git
6 years agosrc/common.c: Fix heap buffer overflows when writing strings in binheader 30/162530/1
Jörn Heusipp [Wed, 14 Jun 2017 10:25:40 +0000 (12:25 +0200)]
src/common.c: Fix heap buffer overflows when writing strings in binheader

Fixes the following problems:
 1. Case 's' only enlarges the buffer by 16 bytes instead of size bytes.
 2. psf_binheader_writef() enlarges the header buffer (if needed) prior to the
    big switch statement by an amount (16 bytes) which is enough for all cases
    where only a single value gets added. Cases 's', 'S', 'p' however
    additionally write an arbitrary length block of data and again enlarge the
    buffer to the required amount. However, the required space calculation does
    not take into account the size of the length field which gets output before
    the data.
 3. Buffer size requirement calculation in case 'S' does not account for the
    padding byte ("size += (size & 1) ;" happens after the calculation which
    uses "size").
 4. Case 'S' can overrun the header buffer by 1 byte when no padding is
    involved
    ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size + 1) ;" while
    the buffer is only guaranteed to have "size" space available).
 5. "psf->header.ptr [psf->header.indx] = 0 ;" in case 'S' always writes 1 byte
    beyond the space which is guaranteed to be allocated in the header buffer.
 6. Case 's' can overrun the provided source string by 1 byte if padding is
    involved ("memcpy (&(psf->header.ptr [psf->header.indx]), strptr, size) ;"
    where "size" is "strlen (strptr) + 1" (which includes the 0 terminator,
    plus optionally another 1 which is padding and not guaranteed to be
    readable via the source string pointer).

Change-Id: I3decd7a80a46b927b3cd2c975826b888ab5175e9
Closes: https://github.com/erikd/libsndfile/issues/292

6 years agosrc/sd2.c: Fix a psf_binheader_writef usage bug 29/162529/1
Erik de Castro Lopo [Sat, 20 May 2017 09:56:42 +0000 (19:56 +1000)]
src/sd2.c: Fix a psf_binheader_writef usage bug

Unfortunately this bug cannot be found by the compiler and the tests
didn't find it either. It was found during work to improve the type
safety of calls to psf_binheader_writef.

Change-Id: I3621cfd4c564cc00401ca8303c76fe40b451f1c3

6 years agoRF64 tweaks 28/162528/1
Erik de Castro Lopo [Tue, 18 Apr 2017 10:07:03 +0000 (20:07 +1000)]
RF64 tweaks

* Comments.
* Improve the `rf64_long_file_downgrade_test` test.

Change-Id: I53f2562db1bd450b8e449aa7a6a87e9febfeaaad

6 years agoRF64: Fix an RF64_AUTO_DOWNGRADE bug 27/162527/1
Erik de Castro Lopo [Sun, 16 Apr 2017 00:44:28 +0000 (10:44 +1000)]
RF64: Fix an RF64_AUTO_DOWNGRADE bug

Also add a test for this. The test is disabled by default because it
needs to write a 4 Gig file.

Change-Id: If9a18f4f6147e08cfa6f7f35ff66131434f0db20
Closes: https://github.com/erikd/libsndfile/issues/238

6 years agosrc/rf64.c: Fix varargs related bug 69/162269/1
Erik de Castro Lopo [Sun, 16 Apr 2017 07:54:17 +0000 (17:54 +1000)]
src/rf64.c: Fix varargs related bug

C's <stargs.h> functionality isn't type checked so that passing an
`sf_count_t` (64 bits) by mistake in place of a `unit32_t` can cause
errors. This would be fine if it was an error on every architecture
and platform, but its not. This particular problem only manifested
on armhf and some other Arm architectures. It was not an issue on
32 bit x86.

I have now fixed variants of this same bug several times.

Change-Id: Ie0024ce14affeb6034071aa80c339da915f8b7e1
Closes: https://github.com/erikd/libsndfile/issues/229

6 years agodouble64_init: Check psf->sf.channels against upper bound 68/162168/1 accepted/tizen/4.0/unified/20171204.071001 submit/tizen_4.0/20171130.043308
Fabian Greffrath [Thu, 28 Sep 2017 10:15:04 +0000 (12:15 +0200)]
double64_init: Check psf->sf.channels against upper bound

This prevents division by zero later in the code.

While the trivial case to catch this (i.e. sf.channels < 1) has already
been covered, a crafted file may report a number of channels that is
so high (i.e. > INT_MAX/sizeof(double)) that it "somehow" gets
miscalculated to zero (if this makes sense) in the determination of the
blockwidth. Since we only support a limited number of channels anyway,
make sure to check here as well.

CVE-2017-14634

Change-Id: Ifee1ff6c9af452f38725f4b599eae4ac069b93b5
Closes: https://github.com/erikd/libsndfile/issues/318
Signed-off-by: Erik de Castro Lopo <erikd@mega-nerd.com>
6 years agoDisable unused GSM610 / G72X 93/136093/2 accepted/tizen/4.0/unified/20170816.013734 accepted/tizen/4.0/unified/20170828.222909 accepted/tizen/unified/20170703.064034 submit/tizen/20170628.062654 submit/tizen_4.0/20170811.094300 submit/tizen_4.0/20170828.100006 tizen_4.0.IoT.p1_release tizen_4.0.m2_release
Seungbae Shin [Mon, 26 Jun 2017 08:49:36 +0000 (17:49 +0900)]
Disable unused GSM610 / G72X

Change-Id: Ic625333d83c9f226da66d807b314e76670459519

6 years agoDisable unused ALAC(Apple Lossless Audio Codec) / CAF(Core Audio Format) 03/75903/2
Seungbae Shin [Wed, 22 Jun 2016 06:08:50 +0000 (15:08 +0900)]
Disable unused ALAC(Apple Lossless Audio Codec) / CAF(Core Audio Format)

Change-Id: Iad288d072e30572f79fef1c6b3d86b602238a54a

6 years agosrc/aiff.c: Fix a buffer read overflow 44/135344/1 accepted/tizen/unified/20170627.043336 submit/tizen/20170623.094947
Erik de Castro Lopo [Tue, 23 May 2017 10:15:24 +0000 (20:15 +1000)]
src/aiff.c: Fix a buffer read overflow

Secunia Advisory SA76717.

Found by: Laurent Delosieres, Secunia Research at Flexera Software

https://github.com/erikd/libsndfile/commit/f833c53cb596e9e1792949f762e0b33661822748

Change-Id: I3faddf7f078acf539f58b65ba593e4f8ecfdb13d

6 years agoApply Tizen patches 84/134384/1 accepted/tizen/unified/20170630.083223 submit/tizen/20170621.021850
Seungbae Shin [Wed, 16 Mar 2016 13:09:47 +0000 (22:09 +0900)]
Apply Tizen patches

1. Remove FLAC dependancy
2. use dlopen for vorbis encoder to load so when actual needed, this will reduce runtime memory consumption

Change-Id: Id3c81f7e65c2fcd6784970b817d81f50eb0ca2d6

6 years agoFix build error 81/134381/1
Seungbae Shin [Thu, 15 Jun 2017 08:28:03 +0000 (17:28 +0900)]
Fix build error

1. Add python to BuildRequire
2. Add autogen generated test files

Change-Id: I6ae51fbdd9064bc16ff247d2fd4c21fe47a1b742

6 years agoSync with upstream 80/134380/1
Seungbae Shin [Thu, 15 Jun 2017 08:04:44 +0000 (17:04 +0900)]
Sync with upstream

Change-Id: I14d5d1e0538483b3d6bff9d3ce35adca1348e78f

6 years agoMerge branch 'upstream' into tizen 79/134379/1
Seungbae Shin [Fri, 16 Jun 2017 06:51:04 +0000 (15:51 +0900)]
Merge branch 'upstream' into tizen

Change-Id: I0adafdc190adb3e5f56887d1f83967eb2efd36b9

6 years agoImported Upstream version 1.0.28 50/134350/1 upstream/1.0.28
Seungbae Shin [Thu, 15 Jun 2017 03:30:39 +0000 (12:30 +0900)]
Imported Upstream version 1.0.28

Change-Id: Id92ab7f7f5dc6513db5650da4eda1e4f392bc54f

6 years agoFix CVE defect 69/133969/1 accepted/tizen/unified/20170615.020636 submit/tizen/20170614.062816
Seungbae Shin [Wed, 31 May 2017 13:28:19 +0000 (22:28 +0900)]
Fix CVE defect

- Related CVE defects
  https://nvd.nist.gov/vuln/detail/CVE-2017-7586

- Fixed by applying following upstream patch.
  https://github.com/erikd/libsndfile/commit/f457b7b5ecfe91697ed01cfc825772c4d8de1236

Change-Id: I5d95a79e6d6353fd57d9953d1824a1fa9545a492

6 years agoFix CVE defects 68/133968/1
Seungbae Shin [Wed, 31 May 2017 12:13:46 +0000 (21:13 +0900)]
Fix CVE defects

- Related CVE defects
  https://nvd.nist.gov/vuln/detail/CVE-2017-7585
  https://nvd.nist.gov/vuln/detail/CVE-2017-7741
  https://nvd.nist.gov/vuln/detail/CVE-2017-7742

- Fixed by applying following upstream patch.
  https://github.com/erikd/libsndfile/commit/60b234301adf258786d8b90be5c1d437fc8799e0

Change-Id: I44d9943eafb9885fb255adc632028aac3a00bf43

7 years agoUse license macro in spec 87/120287/1 accepted/tizen/unified/20170411.164123 submit/tizen/20170411.053308 tizen_4.0.m1_release
Jeongho Mok [Wed, 22 Mar 2017 07:55:18 +0000 (16:55 +0900)]
Use license macro in spec

Change-Id: Ie4070a4133383bc52bc748ae28ccf2a36ce40fa5

7 years agoFix a seek regression in 1.0.26. 81/83881/1 accepted/tizen_3.0.m2_mobile accepted/tizen_3.0.m2_tv accepted/tizen_3.0.m2_wearable accepted/tizen_common accepted/tizen_ivi accepted/tizen_mobile accepted/tizen_tv accepted/tizen_wearable tizen_3.0.m2 tizen_3.0_tv accepted/tizen/3.0.m2/mobile/20170105.024752 accepted/tizen/3.0.m2/tv/20170105.024927 accepted/tizen/3.0.m2/wearable/20170105.025051 accepted/tizen/3.0/common/20161114.111040 accepted/tizen/3.0/ivi/20161011.050507 accepted/tizen/3.0/mobile/20161015.033840 accepted/tizen/3.0/tv/20161016.005036 accepted/tizen/3.0/wearable/20161015.083220 accepted/tizen/common/20160818.144334 accepted/tizen/ivi/20160818.231816 accepted/tizen/mobile/20160818.231638 accepted/tizen/tv/20160818.231748 accepted/tizen/unified/20170309.040119 accepted/tizen/wearable/20160818.231717 submit/tizen/20160818.052348 submit/tizen_3.0.m2/20170104.093753 submit/tizen_3.0_common/20161104.104000 submit/tizen_3.0_ivi/20161010.000004 submit/tizen_3.0_mobile/20161015.000004 submit/tizen_3.0_tv/20161015.000003 submit/tizen_3.0_wearable/20161015.000003 submit/tizen_unified/20170308.100414
Seungbae Shin [Fri, 12 Aug 2016 12:46:52 +0000 (21:46 +0900)]
Fix a seek regression in 1.0.26.

https://github.com/erikd/libsndfile/commit/f29c0dc2091febb2df6198c38b1664c30c3ea77d

Change-Id: I3db5517f49ac93d1390838625805b76532781ae5

8 years agouse dlopen for vorbis encoder to load so when actual needed, this will reduce runtime... 05/68105/3 accepted/tizen/common/20160504.125847 accepted/tizen/ivi/20160504.011131 accepted/tizen/mobile/20160504.011037 accepted/tizen/tv/20160504.011055 accepted/tizen/wearable/20160504.011111 submit/tizen/20160503.074218
Seungbae Shin [Mon, 2 May 2016 08:32:17 +0000 (17:32 +0900)]
use dlopen for vorbis encoder to load so when actual needed, this will reduce runtime memory consumption

Change-Id: I7b3b6b82cafde364b752812523221ce430ae0526

8 years agoDisable vorbis encoder 48/67948/1 accepted/tizen/common/20160504.125009 accepted/tizen/ivi/20160503.011420 accepted/tizen/mobile/20160503.011315 accepted/tizen/tv/20160503.011344 accepted/tizen/wearable/20160503.011402 submit/tizen/20160502.101731
Seungbae Shin [Fri, 29 Apr 2016 09:38:05 +0000 (18:38 +0900)]
Disable vorbis encoder

Change-Id: Ib6c62b16525c929d1329b9dbe447c420a56ef86b

8 years agoRemove FLAC dependancy 49/62749/1 accepted/tizen/common/20160426.143037 accepted/tizen/ivi/20160425.231739 accepted/tizen/mobile/20160425.231717 accepted/tizen/tv/20160425.231734 accepted/tizen/wearable/20160425.231726 submit/tizen/20160425.080416
Seungbae Shin [Wed, 16 Mar 2016 13:09:47 +0000 (22:09 +0900)]
Remove FLAC dependancy

Change-Id: Id867eefde74690c28f350983cc870d44d28cd36e

8 years agosync with upstream 48/62748/1
Seungbae Shin [Wed, 16 Mar 2016 12:46:30 +0000 (21:46 +0900)]
sync with upstream

Change-Id: I4bf9c5dc1f6ffc8de6bd35ba8c3c936d8079c744

8 years agoMerge remote-tracking branch 'remotes/origin/upstream' into tizen 47/62747/1
Seungbae Shin [Fri, 18 Mar 2016 02:52:57 +0000 (11:52 +0900)]
Merge remote-tracking branch 'remotes/origin/upstream' into tizen

Change-Id: I258d58f7d02f8d0c9da99204a82e283d234406ec

8 years agoImported Upstream version 1.0.26 48/62548/1 upstream/1.0.26
Seungbae Shin [Wed, 16 Mar 2016 11:18:18 +0000 (20:18 +0900)]
Imported Upstream version 1.0.26

Change-Id: I94b0a35e0ffccabf1b50b62e8f0223e4b617e6f3

8 years agoEnable ogg with flac disable 26/44026/2 tizen_3.0.m1_mobile tizen_3.0.m1_tv accepted/tizen/ivi/20160218.025309 accepted/tizen/mobile/20150717.003210 accepted/tizen/tv/20150717.003220 accepted/tizen/wearable/20150717.003233 submit/tizen/20150716.112552 submit/tizen_common/20151015.190624 submit/tizen_common/20151019.135620 submit/tizen_common/20151023.083358 submit/tizen_common/20151026.085049 submit/tizen_ivi/20160217.000000 submit/tizen_ivi/20160217.000006 tizen_3.0.m1_mobile_release tizen_3.0.m1_tv_release tizen_3.0.m2.a1_mobile_release tizen_3.0.m2.a1_tv_release
Seungbae Shin [Thu, 16 Jul 2015 08:33:11 +0000 (17:33 +0900)]
Enable ogg with flac disable

Change-Id: Ic80c209ea2396952fd175c44568a5fc78bfb2b73

10 years agoresetting manifest requested domain to floor 77/5177/1 accepted/tizen/ivi/genivi accepted/tizen/ivi/stable accepted/tizen_3.0.2014.q3_common accepted/tizen_3.0.m14.3_ivi accepted/tizen_generic tizen_3.0.2014.q3_common tizen_3.0.2014.q4_common tizen_3.0.2015.q1_common tizen_3.0.2015.q2_common tizen_3.0.m14.2_ivi tizen_3.0.m14.3_ivi tizen_3.0_ivi tizen_ivi_genivi accepted/tizen/20130710.215738 accepted/tizen/20130912.101429 accepted/tizen/20130912.102038 accepted/tizen/20130912.151346 accepted/tizen/20130912.191522 accepted/tizen/20130912.195547 accepted/tizen/ivi/genivi/20140131.023645 ivi_oct_m2 submit/tizen/20130710.132701 submit/tizen/20130912.080030 submit/tizen/20130912.090337 submit/tizen_ivi_genivi/20140131.023338 submit/tizen_mobile/20141120.000000 tizen_3.0.2014.q3_common_release tizen_3.0.m14.2_ivi_release tizen_3.0.m14.3_ivi_release tizen_3.0_ivi_release
Alexandru Cornea [Mon, 1 Jul 2013 16:19:49 +0000 (19:19 +0300)]
resetting manifest requested domain to floor

11 years agoFixed package groups accepted/tizen/20130503.222102 accepted/tizen/20130520.100001 accepted/trunk/20130319.044506 submit/tizen/20130503.224035 submit/tizen/20130509.181236 submit/tizen/20130517.023115 submit/trunk/20130319.022803
Anas Nashif [Tue, 19 Mar 2013 02:28:01 +0000 (19:28 -0700)]
Fixed package groups

11 years agoremove patches
Anas Nashif [Wed, 7 Nov 2012 23:52:50 +0000 (15:52 -0800)]
remove patches

11 years agoocloexec
Anas Nashif [Wed, 7 Nov 2012 23:52:03 +0000 (15:52 -0800)]
ocloexec

11 years agopaf zero division
Anas Nashif [Wed, 7 Nov 2012 23:51:40 +0000 (15:51 -0800)]
paf zero division

11 years agoexample fix
Anas Nashif [Wed, 7 Nov 2012 23:51:10 +0000 (15:51 -0800)]
example fix

11 years agoImported Upstream version 1.0.25 upstream/1.0.25
Anas Nashif [Wed, 7 Nov 2012 23:49:46 +0000 (15:49 -0800)]
Imported Upstream version 1.0.25

11 years agoadd packaging
Anas Nashif [Wed, 7 Nov 2012 23:49:46 +0000 (15:49 -0800)]
add packaging