projects
/
pspp
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1b8d98e
)
ascii: Avoid assertion failure on width underflow in text_draw().
author
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 19 Apr 2024 16:46:05 +0000
(09:46 -0700)
committer
Ben Pfaff
<blp@cs.stanford.edu>
Fri, 19 Apr 2024 16:46:19 +0000
(09:46 -0700)
Thanks to Zhou Geng for reporting this bug as poc33 in the report here:
https://lists.gnu.org/archive/html/bug-gnu-pspp/2024-03/msg00015.html
src/output/ascii.c
patch
|
blob
|
history
diff --git
a/src/output/ascii.c
b/src/output/ascii.c
index d581675fe37d99bf7f63cfb6d2332b9c0b5b1b3e..2676792b8da6bae07ef5f019321baf4c959080e0 100644
(file)
--- a/
src/output/ascii.c
+++ b/
src/output/ascii.c
@@
-827,6
+827,11
@@
text_draw (struct ascii_driver *a, enum table_halign halign, bool numeric,
width -= w;
}
}
+ if (width >= SIZE_MAX / 2)
+ {
+ /* Width underflow. */
+ return;
+ }
if (n == 0)
return;