aboutsummaryrefslogtreecommitdiffstats
path: root/frame.c
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-20 13:17:13 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-20 13:17:13 +0000
commit05809b3647bfcb8d653fe8bb01f0f59226f6a6b4 (patch)
treea1630d700df15f26199ebe87b4905764b4e3987e /frame.c
parentremove XXMakefile config.h (diff)
downloadw3m-05809b3647bfcb8d653fe8bb01f0f59226f6a6b4.tar.gz
w3m-05809b3647bfcb8d653fe8bb01f0f59226f6a6b4.zip
fix possible buffer overrun
Diffstat (limited to '')
-rw-r--r--frame.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/frame.c b/frame.c
index 9068325..5850f7f 100644
--- a/frame.c
+++ b/frame.c
@@ -1,4 +1,4 @@
-/* $Id: frame.c,v 1.4 2001/11/16 22:02:00 ukai Exp $ */
+/* $Id: frame.c,v 1.5 2001/11/20 13:17:13 ukai Exp $ */
#include "fm.h"
#include "parsetagx.h"
#include "myctype.h"
@@ -38,8 +38,10 @@ newFrameSet(struct parsed_tag *tag)
if (cols) {
length[i] = p = cols;
while (*p != '\0')
- if (*p++ == ',')
+ if (*p++ == ',') {
length[++i] = p;
+ if (i >= sizeof(length) / sizeof(length[0]) - 2) break;
+ }
length[++i] = p + 1;
}
if (i > 1) {
@@ -74,8 +76,10 @@ newFrameSet(struct parsed_tag *tag)
if (rows) {
length[i] = p = rows;
while (*p != '\0')
- if (*p++ == ',')
+ if (*p++ == ',') {
length[++i] = p;
+ if (i >= sizeof(length) / sizeof(length[0]) - 2) break;
+ }
length[++i] = p + 1;
}
if (i > 1) {