changeset 31918:3103448dcf28

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.
author reimar
date Sat, 21 Aug 2010 10:08:29 +0000
parents d0d09a75bb17
children d9a6b45b8ef9
files stream/stream.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stream/stream.c	Sat Aug 21 10:07:38 2010 +0000
+++ b/stream/stream.c	Sat Aug 21 10:08:29 2010 +0000
@@ -617,7 +617,7 @@
     }
     s->buf_pos += len;
   } while(!end);
+  ptr[0] = 0;
   if(s->eof && ptr == mem) return NULL;
-  ptr[0] = 0;
   return mem;
 }