X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Fber_oct.c;h=a88da376f8aa1f3461aa3f5bc6a5ff94c9865c6e;hp=8c60fc7b81c1dce8dd1ff80649e1e5adbbf47c3d;hb=f0df1959fda559c0d952810c338a9fde667b5a63;hpb=833bf58328945361db8a744c0dec2c925c97d43a diff --git a/src/ber_oct.c b/src/ber_oct.c index 8c60fc7..a88da37 100644 --- a/src/ber_oct.c +++ b/src/ber_oct.c @@ -1,5 +1,5 @@ /* This file is part of the YAZ toolkit. - * Copyright (C) 1995-2013 Index Data + * Copyright (C) Index Data * See the file LICENSE for details. */ @@ -53,9 +53,7 @@ int ber_octetstring(ODR o, Odr_oct *p, int cons) return 0; } p->len = len; - p->buf = odr_malloc(o, len + 1); - memcpy(p->buf, o->op->bp, len); - p->buf[len] = '\0'; + p->buf = odr_strdupn(o, o->op->bp, len); o->op->bp += len; return 1; case ODR_ENCODE: