Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
GIMP
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
2,750
Issues
2,750
List
Boards
Labels
Service Desk
Milestones
Merge Requests
34
Merge Requests
34
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
External Wiki
External Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
GNOME
GIMP
Commits
376ad788
Commit
376ad788
authored
Aug 04, 2011
by
Nils Philippsen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
file-gif-load: fix heap corruption and buffer overflow (CVE-2011-2896)
parent
b1a3de76
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
6 deletions
+9
-6
plug-ins/common/file-gif-load.c
plug-ins/common/file-gif-load.c
+9
-6
No files found.
plug-ins/common/file-gif-load.c
View file @
376ad788
...
...
@@ -713,7 +713,8 @@ LZWReadByte (FILE *fd,
static
gint
firstcode
,
oldcode
;
static
gint
clear_code
,
end_code
;
static
gint
table
[
2
][(
1
<<
MAX_LZW_BITS
)];
static
gint
stack
[(
1
<<
(
MAX_LZW_BITS
))
*
2
],
*
sp
;
#define STACK_SIZE ((1 << (MAX_LZW_BITS)) * 2)
static
gint
stack
[
STACK_SIZE
],
*
sp
;
gint
i
;
if
(
just_reset_LZW
)
...
...
@@ -788,7 +789,7 @@ LZWReadByte (FILE *fd,
return
firstcode
&
255
;
}
else
if
(
code
==
end_code
)
else
if
(
code
==
end_code
||
code
>
max_code
)
{
gint
count
;
guchar
buf
[
260
];
...
...
@@ -807,13 +808,14 @@ LZWReadByte (FILE *fd,
incode
=
code
;
if
(
code
>
=
max_code
)
if
(
code
=
=
max_code
)
{
*
sp
++
=
firstcode
;
if
(
sp
<
&
(
stack
[
STACK_SIZE
]))
*
sp
++
=
firstcode
;
code
=
oldcode
;
}
while
(
code
>=
clear_code
)
while
(
code
>=
clear_code
&&
sp
<
&
(
stack
[
STACK_SIZE
])
)
{
*
sp
++
=
table
[
1
][
code
];
if
(
code
==
table
[
0
][
code
])
...
...
@@ -824,7 +826,8 @@ LZWReadByte (FILE *fd,
code
=
table
[
0
][
code
];
}
*
sp
++
=
firstcode
=
table
[
1
][
code
];
if
(
sp
<
&
(
stack
[
STACK_SIZE
]))
*
sp
++
=
firstcode
=
table
[
1
][
code
];
if
((
code
=
max_code
)
<
(
1
<<
MAX_LZW_BITS
))
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment