artulab
projects
/
openbsd
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
27bacb1
)
The character buffer should be resized using recallocarray()
author
deraadt
<deraadt@openbsd.org>
Sun, 2 Apr 2017 23:02:06 +0000
(23:02 +0000)
committer
deraadt
<deraadt@openbsd.org>
Sun, 2 Apr 2017 23:02:06 +0000
(23:02 +0000)
ok millert and nicm a while ago
usr.bin/less/line.c
patch
|
blob
|
history
diff --git
a/usr.bin/less/line.c
b/usr.bin/less/line.c
index
629402d
..
42d1a24
100644
(file)
--- a/
usr.bin/less/line.c
+++ b/
usr.bin/less/line.c
@@
-94,8
+94,8
@@
expand_linebuf(void)
int new_size = size_linebuf * 2;
/* Just realloc to expand the buffer, if we can. */
- char *new_buf = re
alloc(linebuf, new_size
);
- char *new_attr = re
alloc(attr, new_size
);
+ char *new_buf = re
callocarray(linebuf, size_linebuf, new_size, 1
);
+ char *new_attr = re
callocarray(attr, size_linebuf, new_size, 1
);
if (new_buf == NULL || new_attr == NULL) {
free(new_attr);
free(new_buf);