Browse code

Fix for CVE-2017-11423

Change-Id: I5c2fbe962430676ca710c23d1ec957ba50012a6b
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/5365
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Sharath George

Ajay Kaher authored on 2018/07/17 23:47:05
Showing 2 changed files
1 1
new file mode 100644
... ...
@@ -0,0 +1,14 @@
0
+diff -Naur libmspack-0.5alpha/mspack/cabd.c libmspack-0.5alpha-a/mspack/cabd.c
1
+--- libmspack-0.5alpha/mspack/cabd.c	2015-01-18 18:29:24.000000000 +0530
2
+@@ -525,6 +525,10 @@
3
+ 
4
+   /* read up to 256 bytes */
5
+   len = sys->read(fh, &buf[0], 256);
6
++  if (len <= 0) {
7
++    *error = MSPACK_ERR_READ;
8
++    return NULL;
9
++  }
10
+ 
11
+   /* search for a null terminator in the buffer. reject empty strings */
12
+   for (i = 1, ok = 0; i < len; i++) if (!buf[i]) { ok = 1; break; }
... ...
@@ -1,7 +1,7 @@
1 1
 Summary:        A library that provides compression and decompression of file formats used by Microsoft
2 2
 Name:           libmspack
3 3
 Version:        0.5alpha
4
-Release:        4%{?dist}
4
+Release:        5%{?dist}
5 5
 License:        LGPLv2+
6 6
 URL:            http://www.cabextract.org.uk/libmspack/libmspack-0.5alpha.tar.gz
7 7
 Group:          Applications/System
... ...
@@ -10,6 +10,7 @@ Distribution:   Photon
10 10
 Source0:        http://www.cabextract.org.uk/libmspack/%{name}-%{version}.tar.gz
11 11
 %define sha1    libmspack=226f19b1fc58e820671a1749983b06896e108cc4
12 12
 Patch0:         CVE-2017-6419.patch
13
+Patch1:         CVE-2017-11423.patch
13 14
 %description
14 15
 A library that provides compression and decompression of file formats used by Microsoft
15 16
 
... ...
@@ -22,6 +23,7 @@ It contains the libraries and header files to create applications.
22 22
 %prep
23 23
 %setup -q
24 24
 %patch0 -p1
25
+%patch1 -p1
25 26
 %build
26 27
 ./configure --prefix=/usr
27 28
 make %{?_smp_mflags}
... ...
@@ -47,6 +49,8 @@ cd test
47 47
 %{_libdir}/*.so
48 48
 
49 49
 %changelog
50
+*   Mon Jul 16 2018 Ajay Kaher <akaher@vmware.com> 0.5alpha-5
51
+-   Patch for CVE-2017-11423
50 52
 *   Mon May 21 2018 Anish Swaminathan <anishs@vmware.com> 0.5alpha-4
51 53
 -   Patch for CVE-2017-6419
52 54
 *   Fri Jun 23 2017 Xiaolin Li <xiaolinl@vmware.com> 0.5alpha-3