Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Amelia S. Greene
ristretto
Commits
1a5e3f1a
Commit
1a5e3f1a
authored
Dec 21, 2012
by
Eric Koegel
Committed by
Stephan Arts
Jan 06, 2013
Browse files
Fixed an overflow when comparing filenames with large numbers in them. (Bug #9485)
Signed-off-by:
Stephan Arts
<
stephan@xfce.org
>
parent
5f302be6
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/image_list.c
View file @
1a5e3f1a
...
...
@@ -1363,8 +1363,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile *a, RsttoFile *b)
const
gchar
*
bp
=
b_base
;
gint
result
=
0
;
guint
a_num
=
0
;
guint
b_num
=
0
;
guint
64
a_num
=
0
;
guint
64
b_num
=
0
;
/* try simple (fast) ASCII comparison first */
for
(;;
++
ap
,
++
bp
)
...
...
@@ -1404,8 +1404,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile *a, RsttoFile *b)
*/
if
(
g_ascii_isdigit
(
ac
)
&&
g_ascii_isdigit
(
bc
))
{
a_num
=
strtoul
(
ap
,
NULL
,
10
);
b_num
=
strtoul
(
bp
,
NULL
,
10
);
a_num
=
strtoul
l
(
ap
,
NULL
,
10
);
b_num
=
strtoul
l
(
bp
,
NULL
,
10
);
if
(
a_num
<
b_num
)
result
=
-
1
;
...
...
@@ -1418,8 +1418,8 @@ cb_rstto_image_list_image_name_compare_func (RsttoFile *a, RsttoFile *b)
g_ascii_isdigit
(
*
(
ap
-
1
))
&&
g_ascii_isdigit
(
*
(
bp
-
1
))
)
{
a_num
=
strtoul
(
ap
-
1
,
NULL
,
10
);
b_num
=
strtoul
(
bp
-
1
,
NULL
,
10
);
a_num
=
strtoul
l
(
ap
-
1
,
NULL
,
10
);
b_num
=
strtoul
l
(
bp
-
1
,
NULL
,
10
);
if
(
a_num
<
b_num
)
result
=
-
1
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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