dcraw/dcraw-CVE-2018-19655.patch
Fridrich Strba a0d762e298 Accepting request 827153 from home:elimat:branches:graphics
- Update to version 9.28.0:
  dcraw - revision 1.478
  * Caught up on two years' worth of new cameras.
- Update upstream URL to new address
- Add patches for CVEs:
  * dcraw-CVE-2017-13735.patch (CVE-2017-13735)
  * dcraw-CVE-2017-14608.patch (CVE-2017-14608)
  * dcraw-CVE-2018-19655.patch (CVE-2018-19655)
  * dcraw-CVE-2018-5801.patch (CVE-2018-5801)
- Run spec-cleaner
  * Remove package groups

OBS-URL: https://build.opensuse.org/request/show/827153
OBS-URL: https://build.opensuse.org/package/show/graphics/dcraw?expand=0&rev=50
2020-08-24 14:05:29 +00:00

40 lines
1006 B
Diff

Author: Filip Hroch <hroch@physics.muni.cz>
Description: stack-based buffer overflow bug
--- a/dcraw.c
+++ b/dcraw.c
@@ -8345,9 +8345,15 @@
{
UINT64 bitbuf=0;
int vbits, col, i, c;
- ushort img[2][2064];
+ ushort *img;
double sum[]={0,0};
+#define IMG2D(row,col) \
+ img[(row)*width+(col)]
+
+ img = (ushort *) malloc(2*width*sizeof(ushort));
+ merror (img, "find_green()");
+
FORC(2) {
fseek (ifp, c ? off1:off0, SEEK_SET);
for (vbits=col=0; col < width; col++) {
@@ -8356,13 +8362,14 @@
for (i=0; i < bite; i+=8)
bitbuf |= (unsigned) (fgetc(ifp) << i);
}
- img[c][col] = bitbuf << (64-bps-vbits) >> (64-bps);
+ IMG2D(c,col) = bitbuf << (64-bps-vbits) >> (64-bps);
}
}
FORC(width-1) {
- sum[ c & 1] += ABS(img[0][c]-img[1][c+1]);
- sum[~c & 1] += ABS(img[1][c]-img[0][c+1]);
+ sum[ c & 1] += ABS(IMG2D(0,c)-IMG2D(1,c+1));
+ sum[~c & 1] += ABS(IMG2D(1,c)-IMG2D(0,c+1));
}
+ free(img);
return 100 * log(sum[0]/sum[1]);
}