From: Wilfried Göesgens Date: Mon, 27 Jul 2009 18:10:21 +0000 (+0000) Subject: * add additional bytes to the buffer, so swapping names doesn't buffer overrun. Fixes... X-Git-Tag: v7.86~953 X-Git-Url: https://code.citadel.org/?p=citadel.git;a=commitdiff_plain;h=7adb60b58075385e78a1ea1dd7898164ffd1a016 * add additional bytes to the buffer, so swapping names doesn't buffer overrun. Fixes Bug 473 --- diff --git a/webcit/vcard_edit.c b/webcit/vcard_edit.c index b690e01cc..e05bb11c2 100644 --- a/webcit/vcard_edit.c +++ b/webcit/vcard_edit.c @@ -253,7 +253,12 @@ void fetchname_parsed_vcard(struct vCard *v, char **storename) { len); } else { - *storename = strdup(name); + size_t len; + + len = strlen (name); + + *storename = malloc(len + 3); /* \0 + eventualy missing ', '*/ + memcpy(*storename, name, len + 1); } /* vcard_n_prettyize(storename); */ }