mirror of
https://github.com/sheumann/hush.git
synced 2025-01-18 07:31:34 +00:00
Patch from David Updegraff to avoid corrupting memory while parsing the
networks/iterfaces file with next_word routine. Without this, next_word increments one beyond the end of the string.
This commit is contained in:
parent
343658582b
commit
2894266f12
@ -630,8 +630,11 @@ static char *next_word(char **buf)
|
|||||||
return(NULL);
|
return(NULL);
|
||||||
}
|
}
|
||||||
*buf = word + length;
|
*buf = word + length;
|
||||||
**buf = '\0';
|
/*DBU:[dave@cray.com] if we are already at EOL dont't increment beyond it */
|
||||||
(*buf)++;
|
if (**buf) {
|
||||||
|
**buf = '\0';
|
||||||
|
(*buf)++;
|
||||||
|
}
|
||||||
|
|
||||||
return word;
|
return word;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user