projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
8d97f84
)
data-out.c: Added assertion to avoid out of bounds memory access
author
John Darrington
<john@darrington.wattle.id.au>
Sat, 1 Dec 2012 06:07:13 +0000
(07:07 +0100)
committer
John Darrington
<john@darrington.wattle.id.au>
Sat, 1 Dec 2012 06:07:13 +0000
(07:07 +0100)
This could (has!) happened if the locale is not correctly set
src/data/data-out.c
patch
|
blob
|
history
diff --git
a/src/data/data-out.c
b/src/data/data-out.c
index 10ca4ede77f9e4fbe742927ad80a9fce4471d444..94e72f668be641d81bedca51660e8716e5773c2b 100644
(file)
--- a/
src/data/data-out.c
+++ b/
src/data/data-out.c
@@
-864,6
+864,7
@@
rounder_init (struct rounder *r, double number, int max_decimals)
r->leading_zeros = strspn (r->string, "0.");
r->leading_nines = strspn (r->string, "9.");
r->integer_digits = strchr (r->string, '.') - r->string;
+ assert (r->integer_digits < 64);
assert (r->integer_digits >= 0);
r->negative = number < 0;
}