Prevent buf2 buffer overflow by limiting the the amount of bytes printed
This commit is contained in:
parent
58a61c4c3b
commit
13c23fd71b
|
|
@ -83,7 +83,8 @@ pvec(struct dvec *d)
|
||||||
|
|
||||||
if (d->v_numdims > 1) {
|
if (d->v_numdims > 1) {
|
||||||
dimstring(d->v_dims, d->v_numdims, buf3);
|
dimstring(d->v_dims, d->v_numdims, buf3);
|
||||||
snprintf(buf2, BSIZE_SP, ", dims = [%s]", buf3);
|
size_t icopy = BSIZE_SP - 11;
|
||||||
|
snprintf(buf2, icopy, ", dims = [%s]", buf3);
|
||||||
strcat(buf, buf2);
|
strcat(buf, buf2);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue