if (new_l + 1 > buf_len) {
buf_len = 1 + buf_len + 2 * new_l;
nbuf = emalloc(buf_len);
- strcpy(nbuf, buf);
+ strcpy(nbuf, buf, buf_len-1);
efree(buf);
buf = nbuf;
}
if (new_l + 1 > buf_len) {
buf_len = 1 + buf_len + 2 * new_l;
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
- strcpy(nbuf, buf);
+ strcpy(nbuf, buf, buf_len-1);
efree(buf);
buf = nbuf;
}
if (new_l + 1 > buf_len) {
buf_len = new_l + 1; /* now we know exactly how long it is */
nbuf = safe_emalloc(buf_len, sizeof(char), 0);
- strcpy(nbuf, buf);
+ strcpy(nbuf, buf, buf_len-1);
efree(buf);
buf = nbuf;
}