From 3594a53cd5e8569ca76834c2c6282092a7e78349 Mon Sep 17 00:00:00 2001 From: "git@daemon.de" Date: Mon, 10 Mar 2014 17:03:27 +0100 Subject: [PATCH] fixed invalid malloc (notation size, missed trailing zero) --- libpcp/mgmt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libpcp/mgmt.c b/libpcp/mgmt.c index cfd5e0f..dc142b8 100644 --- a/libpcp/mgmt.c +++ b/libpcp/mgmt.c @@ -19,6 +19,8 @@ You can contact me by mail: . */ +#define _XOPEN_SOURCE /* strptime, linux glibc*/ +#define _BSD_SOURCE #include "mgmt.h" @@ -76,7 +78,7 @@ int _check_sigsubs(Buffer *blob, pcp_pubkey_t *p, rfc_pub_sig_s *subheader) { uint16_t nsize = buffer_get16na(blob); uint16_t vsize = buffer_get16na(blob); - char *notation = ucmalloc(nsize); + char *notation = ucmalloc(nsize+1); if(buffer_get_chunk(blob, notation, nsize) == 0) return 1;