Skip to content

Commit 4606c28

Browse files
committed
0.16.1: fix for dcraw ljpeg_start() vulnerability
1 parent 0217a0d commit 4606c28

File tree

6 files changed

+31
-9
lines changed

6 files changed

+31
-9
lines changed

Diff for: Changelog.rus

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
2014-01-17 Alex Tutubalin <lexa@lexa.ru>
1+
2015-05-11 Alex Tutubalin <lexa@lexa.ru>
2+
* Исправлена уязвимость в dcraw:ljpeg_start()
3+
* LibRaw 0.16.1
4+
5+
2014-01-17 Alex Tutubalin <lexa@lexa.ru>
26
* Поддержка камер
37
Добавлены: Fujifilm X-E2,XQ1
48
Обновлены цветовые данные: Nikon D4, 1 AW1/J3; Fuji X-M2
@@ -13,7 +17,7 @@
1317
* Исправлены ошибки компиляции при сборке VS2012 с включенным
1418
OpenMP
1519
* Исправлена опечатка, не дававшая использовать Demosaic Pack GPL2
16-
* LibRaw 0.16.0-Beta1
20+
* LibRaw 0.16.0
1721

1822
2013-11-12 Alex Tutubalin <lexa@lexa.ru>
1923
* Поддержка новых камер

Diff for: Changelog.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
2015-05-11 Alex Tutubalin <lexa@lexa.ru>
2+
* Fix for dcraw ljpeg_start() vulnerability
3+
* LibRaw 0.16.1-Release
4+
15
2014-01-17 Alex Tutubalin <lexa@lexa.ru>
26
* Camera support:
37
Added: Fujifilm XE2, XQ1

Diff for: dcraw/dcraw.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -841,7 +841,8 @@ struct jhead {
841841

842842
int CLASS ljpeg_start (struct jhead *jh, int info_only)
843843
{
844-
int c, tag, len;
844+
int c, tag;
845+
ushort len;
845846
uchar data[0x10000];
846847
const uchar *dp;
847848

Diff for: internal/dcraw_common.cpp

+14-1
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ it under the terms of the one of three licenses as you choose:
2121
for more information
2222
*/
2323

24+
#line 261 "dcraw/dcraw.c"
2425
#include <math.h>
2526
#define CLASS LibRaw::
2627
#include "libraw/libraw_types.h"
@@ -29,6 +30,7 @@ it under the terms of the one of three licenses as you choose:
2930
#include "libraw/libraw.h"
3031
#include "internal/defines.h"
3132
#include "internal/var_defines.h"
33+
#line 272 "dcraw/dcraw.c"
3234
int CLASS fcol (int row, int col)
3335
{
3436
static const char filter[16][16] =
@@ -75,6 +77,7 @@ char *my_strcasestr (char *haystack, const char *needle)
7577
}
7678
#define strcasestr my_strcasestr
7779
#endif
80+
#line 340 "dcraw/dcraw.c"
7881
ushort CLASS sget2 (uchar *s)
7982
{
8083
if (order == 0x4949) /* "II" means little-endian */
@@ -564,10 +567,12 @@ void CLASS canon_load_raw()
564567
#endif
565568
FORC(2) free (huff[c]);
566569
}
570+
#line 841 "dcraw/dcraw.c"
567571

568572
int CLASS ljpeg_start (struct jhead *jh, int info_only)
569573
{
570-
int c, tag, len;
574+
int c, tag;
575+
ushort len;
571576
uchar data[0x10000];
572577
const uchar *dp;
573578

@@ -1153,6 +1158,7 @@ int CLASS minolta_z2()
11531158
if (tail[i]) nz++;
11541159
return nz > 20;
11551160
}
1161+
#line 1436 "dcraw/dcraw.c"
11561162
void CLASS ppm_thumb()
11571163
{
11581164
char *thumb;
@@ -2976,6 +2982,7 @@ void CLASS redcine_load_raw()
29762982
#endif
29772983
#endif
29782984
}
2985+
#line 3983 "dcraw/dcraw.c"
29792986
void CLASS crop_masked_pixels()
29802987
{
29812988
int row, col;
@@ -3081,6 +3088,7 @@ void CLASS remove_zeroes()
30813088
RUN_CALLBACK(LIBRAW_PROGRESS_REMOVE_ZEROES,1,2);
30823089
#endif
30833090
}
3091+
#line 4254 "dcraw/dcraw.c"
30843092
void CLASS gamma_curve (double pwr, double ts, int mode, int imax)
30853093
{
30863094
int i;
@@ -4790,6 +4798,7 @@ void CLASS parse_thumb_note (int base, unsigned toff, unsigned tlen)
47904798
fseek (ifp, save, SEEK_SET);
47914799
}
47924800
}
4801+
#line 5968 "dcraw/dcraw.c"
47934802
void CLASS parse_makernote (int base, int uptag)
47944803
{
47954804
static const uchar xlat[2][256] = {
@@ -5349,6 +5358,7 @@ void CLASS parse_kodak_ifd (int base)
53495358
fseek (ifp, save, SEEK_SET);
53505359
}
53515360
}
5361+
#line 6533 "dcraw/dcraw.c"
53525362
int CLASS parse_tiff_ifd (int base)
53535363
{
53545364
unsigned entries, tag, type, len, plen=16, save;
@@ -6648,6 +6658,7 @@ void CLASS parse_redcine()
66486658
data_offset = get4();
66496659
}
66506660
}
6661+
#line 7936 "dcraw/dcraw.c"
66516662

66526663
/*
66536664
All matrices are from Adobe DNG Converter unless otherwise noted.
@@ -8923,6 +8934,7 @@ void CLASS identify()
89238934
}
89248935

89258936

8937+
#line 10303 "dcraw/dcraw.c"
89268938
void CLASS convert_to_rgb()
89278939
{
89288940
#ifndef LIBRAW_LIBRARY_BUILD
@@ -9153,6 +9165,7 @@ int CLASS flip_index (int row, int col)
91539165
if (flip & 1) col = iwidth - 1 - col;
91549166
return row * iwidth + col;
91559167
}
9168+
#line 10559 "dcraw/dcraw.c"
91569169
void CLASS tiff_set (ushort *ntag,
91579170
ushort tag, ushort type, int count, int val)
91589171
{

Diff for: internal/dcraw_fileio.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ it under the terms of the one of three licenses as you choose:
2121
for more information
2222
*/
2323

24-
#line 4090 "dcraw/dcraw.c"
24+
#line 4091 "dcraw/dcraw.c"
2525
#include <math.h>
2626
#define CLASS LibRaw::
2727
#include "libraw/libraw_types.h"
2828
#define LIBRAW_LIBRARY_BUILD
2929
#include "libraw/libraw.h"
3030
#include "internal/defines.h"
3131
#include "internal/var_defines.h"
32-
#line 4101 "dcraw/dcraw.c"
32+
#line 4102 "dcraw/dcraw.c"
3333
/*
3434
Seach from the current directory up to the root looking for
3535
a ".badpixels" file, and fix those pixels now.
@@ -54,7 +54,7 @@ void CLASS bad_pixels (const char *cfname)
5454
#endif
5555
if (cfname)
5656
fp = fopen (cfname, "r");
57-
#line 4151 "dcraw/dcraw.c"
57+
#line 4152 "dcraw/dcraw.c"
5858
if (!fp)
5959
{
6060
#ifdef LIBRAW_LIBRARY_BUILD
@@ -154,7 +154,7 @@ void CLASS subtract (const char *fname)
154154
RUN_CALLBACK(LIBRAW_PROGRESS_DARK_FRAME,1,2);
155155
#endif
156156
}
157-
#line 10213 "dcraw/dcraw.c"
157+
#line 10214 "dcraw/dcraw.c"
158158
#ifndef NO_LCMS
159159
void CLASS apply_profile (const char *input, const char *output)
160160
{

Diff for: libraw/libraw_version.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ it under the terms of the one of three licenses as you choose:
2525

2626
#define LIBRAW_MAJOR_VERSION 0
2727
#define LIBRAW_MINOR_VERSION 16
28-
#define LIBRAW_PATCH_VERSION 0
28+
#define LIBRAW_PATCH_VERSION 1
2929
#define LIBRAW_VERSION_TAIL Release
3030

3131
#define LIBRAW_SHLIB_CURRENT 10

0 commit comments

Comments
 (0)