projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2f921b6
)
Fix possible divide by zero error
author
John Darrington
<john@cellform.com>
Sun, 4 Jun 2023 16:10:24 +0000
(18:10 +0200)
committer
John Darrington
<john@cellform.com>
Sun, 4 Jun 2023 16:33:30 +0000
(18:33 +0200)
utilities/pspp-dump-sav.c
patch
|
blob
|
history
diff --git
a/utilities/pspp-dump-sav.c
b/utilities/pspp-dump-sav.c
index cb8d804134e4099165cf9c5258fdff5197957590..03f3a7c0dc684981101fada8d185d0794c3503c0 100644
(file)
--- a/
utilities/pspp-dump-sav.c
+++ b/
utilities/pspp-dump-sav.c
@@
-1435,7
+1435,7
@@
open_text_record (struct sfm_reader *r, size_t size, size_t count)
{
struct text_record *text = xmalloc (sizeof *text);
- if (size
_overflow_p (xsum (1, xtimes (size, count
))))
+ if (size
> 0 && size_overflow_p (xsum (1, xtimes (count, size
))))
sys_error (r, "Extension record too large.");
size_t n_bytes = size * count;