r31999 - trunk/stream/stream.c
21 Aug
2010
21 Aug
'10
10:08 a.m.
Author: reimar Date: Sat Aug 21 12:08:29 2010 New Revision: 31999 Log: Make sure we return an "empty" line on eof, to make sure we get no buffer overflows in case some code fails to check the return value. Modified: trunk/stream/stream.c Modified: trunk/stream/stream.c ============================================================================== --- trunk/stream/stream.c Sat Aug 21 12:07:38 2010 (r31998) +++ trunk/stream/stream.c Sat Aug 21 12:08:29 2010 (r31999) @@ -617,7 +617,7 @@ unsigned char* stream_read_line(stream_t } s->buf_pos += len; } while(!end); - if(s->eof && ptr == mem) return NULL; ptr[0] = 0; + if(s->eof && ptr == mem) return NULL; return mem; }
5891
Age (days ago)
5891
Last active (days ago)
0 comments
1 participants
participants (1)
-
reimar