Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
433e835d
Commit
433e835d
authored
May 12, 2014
by
Akos Vandra
Committed by
antirez
May 12, 2014
Browse files
fixed possible buffer overflow error
parent
658ad301
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/rdb.c
View file @
433e835d
...
...
@@ -398,7 +398,7 @@ int rdbSaveDoubleValue(rio *rdb, double val) {
double
min
=
-
4503599627370495
;
/* (2^52)-1 */
double
max
=
4503599627370496
;
/* -(2^52) */
if
(
val
>
min
&&
val
<
max
&&
val
==
((
double
)((
long
long
)
val
)))
ll2string
((
char
*
)
buf
+
1
,
sizeof
(
buf
),(
long
long
)
val
);
ll2string
((
char
*
)
buf
+
1
,
sizeof
(
buf
)
-
1
,(
long
long
)
val
);
else
#endif
snprintf
((
char
*
)
buf
+
1
,
sizeof
(
buf
)
-
1
,
"%.17g"
,
val
);
...
...
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