Browse Source

Prevent buf2 buffer overflow by limiting the the amount of bytes printed

pre-master-46
Holger Vogt 6 years ago
parent
commit
13c23fd71b
  1. 3
      src/frontend/plotting/pvec.c

3
src/frontend/plotting/pvec.c

@ -83,7 +83,8 @@ pvec(struct dvec *d)
if (d->v_numdims > 1) {
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);
}

Loading…
Cancel
Save