From 27b9f8bdac5b224615bec43cc15e758a7a6ef601 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sat, 2 Sep 2006 19:01:35 +0000 Subject: Don't allow \0 in dehacked strings read with DEH_ReadLine. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 594 --- src/deh_io.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/deh_io.c b/src/deh_io.c index 65185ea1..5fd2b546 100644 --- a/src/deh_io.c +++ b/src/deh_io.c @@ -1,7 +1,7 @@ // Emacs style mode select -*- C++ -*- //----------------------------------------------------------------------------- // -// $Id: deh_io.c 175 2005-10-08 20:54:16Z fraggle $ +// $Id: deh_io.c 594 2006-09-02 19:01:35Z fraggle $ // // Copyright(C) 2005 Simon Howard // @@ -163,6 +163,11 @@ char *DEH_ReadLine(deh_context_t *context) return NULL; } + if (c == '\0') + { + return NULL; + } + // cope with lines of any length: increase the buffer size if (pos >= context->readbuffer_size) -- cgit v1.2.3