Skip to content

Commit 1856316

Browse files
committed
iiod-client: iiod_client_read_mask(): Zero terminate buffer
Zero terminate the words buffer, before passing it to sscanf(). Otherwise it might read beyond the bounds of the buffer. Signed-off-by: Lars-Peter Clausen <[email protected]>
1 parent dba8a15 commit 1856316

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

iiod-client.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -492,6 +492,8 @@ static int iiod_client_read_mask(struct iiod_client *client,
492492
else
493493
ret = 0;
494494

495+
buf[words*8] = '\0';
496+
495497
DEBUG("Reading mask\n");
496498

497499
for (i = words, ptr = buf; i > 0; i--) {

0 commit comments

Comments
 (0)