void-packages/srcpkgs/catdoc/patches/002-CVE-2017-11110.patch
Đoàn Trần Công Danh c987560802 srcpkgs/c*: convert patches to -Np1
```sh
git grep -l '^patch_args=-Np0' "srcpkgs/$1*/template" |
while read template; do
	for p in ${template%/template}/patches/*; do
		sed -i '
			\,^[+-][+-][+-] /dev/null,b
			/^[*-]\+ [0-9]\+\(,[0-9]\+\)\? [*-]\+$/b
			s,^[*][*][*] ,&a/,
			/^--- /{
				s,\(^--- \)\(./\)*,\1a/,
				s,[.][Oo][Rr][Ii][Gg]\([	/]\),\1,
				s/[.][Oo][Rr][Ii][Gg]$//
				s/[.]patched[.]\([^.]\)/.\1/
				h
			}
			/^+++ -/{
				g
				s/^--- a/+++ b/
				b
			}
			s,\(^+++ \)\(./\)*,\1b/,
		' "$p"
	done
	sed -i '/^patch_args=/d' $template
done
```
2021-06-20 13:17:29 +07:00

32 lines
1.2 KiB
Diff

Description: CVE-2017-11110: Heap buffer overflow in ole_init
Origin: vendor, https://build.opensuse.org/package/view_file/openSUSE:Maintenance:6985/catdoc.openSUSE_Leap_42.2_Update/CVE-2017-11110.patch?rev=d437c3be72c2e5a3516b75f4e9de6b35
Bug-Debian: https://bugs.debian.org/867717
Bug-SuSE: https://bugzilla.novell.com/show_bug.cgi?id=1047877
Forwarded: no
Author: Andreas Stieger <astieger@suse.com>
Reviewed-by: Salvatore Bonaccorso <carnil@debian.org>
Last-Update: 2017-07-20
--- a/src/ole.c
+++ b/src/ole.c
@@ -106,6 +106,11 @@ FILE* ole_init(FILE *f, void *buffer, si
return NULL;
}
sectorSize = 1<<getshort(oleBuf,0x1e);
+ /* CVE-2017-11110 */
+ if (sectorSize < 4) {
+ fprintf(stderr, "sectorSize < 4 not supported\n");
+ return NULL;
+ }
shortSectorSize=1<<getshort(oleBuf,0x20);
/* Read BBD into memory */
@@ -147,7 +152,7 @@ FILE* ole_init(FILE *f, void *buffer, si
}
fseek(newfile, 512+mblock*sectorSize, SEEK_SET);
- if(fread(tmpBuf+MSAT_ORIG_SIZE+(sectorSize-4)*i,
+ if(fread(tmpBuf+MSAT_ORIG_SIZE+(sectorSize-4)*i, /* >=4 for CVE-2017-11110 */
1, sectorSize, newfile) != sectorSize) {
fprintf(stderr, "Error read MSAT!\n");
ole_finish();