aboutsummaryrefslogtreecommitdiff
path: root/blaze822.c
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2016-07-14 13:27:14 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2016-07-14 13:27:14 +0200
commit1ff1ff3dd0d00990ddf88c37233fdb70dfdad746 (patch)
tree2d7fed64be70972c4e6212fa8d713ff35807537f /blaze822.c
parent266b9048976e6be6168ceac8c5299bed978833bc (diff)
downloadmblaze-1ff1ff3dd0d00990ddf88c37233fdb70dfdad746.tar.gz
blaze822: avoid overflow in blaze822_hdr_
Diffstat (limited to 'blaze822.c')
-rw-r--r--blaze822.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/blaze822.c b/blaze822.c
index b6a5698..7572788 100644
--- a/blaze822.c
+++ b/blaze822.c
@@ -421,7 +421,7 @@ blaze822_hdr_(struct message *mesg, const char *hdr, size_t hdrlen)
{
char *v;
- if (mesg->msg + hdrlen - 1 >= mesg->end)
+ if (hdrlen == 0 || hdrlen-1 >= (size_t)(mesg->end - mesg->msg))
return 0; // header too small for the key, probably empty
// special case: first header, no leading nul