projects
/
mmh
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4cda5cc
)
fix 2fb1dd2271e5be9d0b0c9cbd4e7d6d5d51aaecb9
author
Philipp Takacs
<philipp@bureaucracy.de>
Sun, 24 Apr 2016 12:19:05 +0000
(14:19 +0200)
committer
Philipp Takacs
<philipp@bureaucracy.de>
Sun, 24 Apr 2016 12:19:05 +0000
(14:19 +0200)
Do a length check in the header, but not in the body.
sbr/m_getfld2.c
patch
|
blob
|
history
diff --git
a/sbr/m_getfld2.c
b/sbr/m_getfld2.c
index
488a445
..
956a556
100644
(file)
--- a/
sbr/m_getfld2.c
+++ b/
sbr/m_getfld2.c
@@
-103,6
+103,10
@@
m_getfld2(enum state s, struct field *f, FILE *msg)
return IOERR2;
}
+ if (nchars >= NAMESZ) {
+ ret = LENERR2;
+ }
+
if (*(tmpline + nchars - 1) != '\n') {
ret = FMTERR2;
}
@@
-141,10
+145,6
@@
m_getfld2(enum state s, struct field *f, FILE *msg)
}
}
- if (nchars >= NAMESZ) {
- ret = LENERR2;
- }
-
free(f->value);
f->value = tmpline;
f->valuelen = nchars;