Skip to content

Commit

Permalink
iiod-client: iiod_client_read_mask(): Zero terminate buffer
Browse files Browse the repository at this point in the history
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]>
  • Loading branch information
larsclausen committed Feb 22, 2016
1 parent dba8a15 commit 1856316
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions iiod-client.c
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,8 @@ static int iiod_client_read_mask(struct iiod_client *client,
else
ret = 0;

buf[words*8] = '\0';

DEBUG("Reading mask\n");

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

0 comments on commit 1856316

Please sign in to comment.