summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:29:56 +0100
committerDaniel Borkmann <dborkman@redhat.com>2013-03-16 13:29:56 +0100
commit7cd3e9e94ae848974d52b929fd28652f4c7d48c5 (patch)
tree20aa4e551fc877a184deb1f65fc6497eaba49b04
parentcf73bb526709f6e6783f634b7a8504dbefda9768 (diff)
geoip: make sure we null-terminate after read
Make sure raw is null-terminated after we read the buffer that we receive from the remote end. Detected by coverty scan. Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
-rw-r--r--geoip.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/geoip.c b/geoip.c
index fc61184..2eff817 100644
--- a/geoip.c
+++ b/geoip.c
@@ -190,6 +190,8 @@ again:
if (ret <= 0)
return -EIO;
+ raw[sizeof(raw) - 1] = 0;
+
for (i = 0; i < ret; i++) {
if (!strncmp(raw + i, "Content-Length: ", min(ret - i, lenl))) {
ptr = raw + i + lenl;