X-Git-Url: http://git.indexdata.com/?a=blobdiff_plain;f=src%2Fber_oct.c;h=8e8bb7622a139e936b9d75408a643af47687b365;hb=0123a5450b4a7eb7e0a52869dd5c099e415f5feb;hp=8c60fc7b81c1dce8dd1ff80649e1e5adbbf47c3d;hpb=833bf58328945361db8a744c0dec2c925c97d43a;p=yaz-moved-to-github.git diff --git a/src/ber_oct.c b/src/ber_oct.c index 8c60fc7..8e8bb76 100644 --- a/src/ber_oct.c +++ b/src/ber_oct.c @@ -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: