Module Name: src Committed By: ginsbach Date: Wed Jun 10 04:16:53 UTC 2009
Modified Files: src/bin/ed: main.c Log Message: Make sure that buffer is NULL terminated when input to strip_escapes() is too long. (Thanks jnemeth!) To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/bin/ed/main.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/bin/ed/main.c diff -u src/bin/ed/main.c:1.21 src/bin/ed/main.c:1.22 --- src/bin/ed/main.c:1.21 Wed Jun 10 03:24:27 2009 +++ src/bin/ed/main.c Wed Jun 10 04:16:53 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.21 2009/06/10 03:24:27 ginsbach Exp $ */ +/* $NetBSD: main.c,v 1.22 2009/06/10 04:16:53 ginsbach Exp $ */ /* main.c: This file contains the main control and user-interface routines for the ed line editor. */ @@ -39,7 +39,7 @@ #if 0 static char *rcsid = "@(#)main.c,v 1.1 1994/02/01 00:34:42 alm Exp"; #else -__RCSID("$NetBSD: main.c,v 1.21 2009/06/10 03:24:27 ginsbach Exp $"); +__RCSID("$NetBSD: main.c,v 1.22 2009/06/10 04:16:53 ginsbach Exp $"); #endif #endif /* not lint */ @@ -1329,6 +1329,7 @@ while ((i < (filesz - 1)) && (file[i++] = (*s == '\\') != '\0' ? *++s : *s)) s++; + file[filesz - 1] = '\0'; return file; }