version 1.55, 2014/01/31 16:39:19 |
version 1.57, 2014/04/16 23:22:45 |
|
|
} |
} |
ret = xmalloc(len); |
ret = xmalloc(len); |
memcpy(ret, p, len); |
memcpy(ret, p, len); |
memset(p, '\0', len); |
explicit_bzero(p, len); |
free(bin); |
free(bin); |
return ret; |
return ret; |
} |
} |
|
|
|
|
if (l > 8 * 1024) |
if (l > 8 * 1024) |
fatal("%s: length %u too long", __func__, l); |
fatal("%s: length %u too long", __func__, l); |
|
/* Skip leading zero bytes */ |
|
for (; l > 0 && *s == 0; l--, s++) |
|
; |
p = buf = xmalloc(l + 1); |
p = buf = xmalloc(l + 1); |
/* |
/* |
* If most significant bit is set then prepend a zero byte to |
* If most significant bit is set then prepend a zero byte to |
|
|
} |
} |
memcpy(p, s, l); |
memcpy(p, s, l); |
buffer_put_string(buffer, buf, l + pad); |
buffer_put_string(buffer, buf, l + pad); |
memset(buf, '\0', l + pad); |
explicit_bzero(buf, l + pad); |
free(buf); |
free(buf); |
} |
} |
|
|