[MPlayer-cvslog] r31999 - trunk/stream/stream.c

reimar subversion at mplayerhq.hu
Sat Aug 21 12:08:29 CEST 2010


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;
 }


More information about the MPlayer-cvslog mailing list