From: Arran Cudbard-Bell Date: Thu, 30 Oct 2014 15:06:22 +0000 (-0400) Subject: Copy to octets is not a strdup X-Git-Tag: branch_3_1_x~4828 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=da4f4cce4ca7bb129e8c49366b2430cb43043ab4;p=thirdparty%2Ffreeradius-server.git Copy to octets is not a strdup --- diff --git a/src/lib/value.c b/src/lib/value.c index 1bcbf6d6d57..c70dea57635 100644 --- a/src/lib/value.c +++ b/src/lib/value.c @@ -536,9 +536,9 @@ ssize_t value_data_from_str(TALLOC_CTX *ctx, value_data_t *out, * No 0x prefix, just copy verbatim. */ if ((len < 2) || (strncasecmp(value, "0x", 2) != 0)) { - out->octets = talloc_memdup(ctx, (uint8_t const *)value, len + 1); + out->octets = talloc_memdup(ctx, (uint8_t const *)value, len); talloc_set_type(out->octets, uint8_t); - ret = len + 1; + ret = len; goto finish; }