diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-03-16 13:29:56 +0100 |
---|---|---|
committer | Daniel Borkmann <dborkman@redhat.com> | 2013-03-16 13:29:56 +0100 |
commit | 7cd3e9e94ae848974d52b929fd28652f4c7d48c5 (patch) | |
tree | 20aa4e551fc877a184deb1f65fc6497eaba49b04 | |
parent | cf73bb526709f6e6783f634b7a8504dbefda9768 (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.c | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -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; |