aboutsummaryrefslogtreecommitdiff
path: root/devel/libedit
diff options
context:
space:
mode:
authorSergey Matveychuk <sem@FreeBSD.org>2004-11-22 21:53:23 +0000
committerSergey Matveychuk <sem@FreeBSD.org>2004-11-22 21:53:23 +0000
commit364dd0245977478c1f41352149753688c2a4cf86 (patch)
treef8eb891b615bc5153f095db331a0b5e61a14f137 /devel/libedit
parent5d67f4af8d8f04bf516544d8d2df1988664fd673 (diff)
downloadports-364dd0245977478c1f41352149753688c2a4cf86.tar.gz
ports-364dd0245977478c1f41352149753688c2a4cf86.zip
- Fix possible buffer overflow
PR: ports/70699 Submitted by: Sergey S. Kostyliov <rathamahata(at)ehouse.ru>
Notes
Notes: svn path=/head/; revision=122174
Diffstat (limited to 'devel/libedit')
-rw-r--r--devel/libedit/files/patch-history.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/devel/libedit/files/patch-history.c b/devel/libedit/files/patch-history.c
new file mode 100644
index 000000000000..a035eec96202
--- /dev/null
+++ b/devel/libedit/files/patch-history.c
@@ -0,0 +1,16 @@
+--- history.c.orig Tue Nov 23 01:41:41 2004
++++ history.c Tue Nov 23 01:43:09 2004
+@@ -728,10 +728,10 @@
+ for (i = 0, retval = HLAST(h, &ev);
+ retval != -1;
+ retval = HPREV(h, &ev), i++) {
+- len = strlen(ev.str) * 4;
+- if (len >= max_size) {
++ len = strlen(ev.str) * 4 + 1;
++ if (len > max_size) {
+ char *nptr;
+- max_size = (len + 1023) & 1023;
++ max_size = (len + 1023) & ~1023;
+ nptr = h_realloc(ptr, max_size);
+ if (nptr == NULL) {
+ i = -1;