Module Name:    src
Committed By:   christos
Date:           Wed Jul 18 17:12:39 UTC 2012

Modified Files:
        src/lib/libedit: chared.c

Log Message:
>From Kamil Dudka: fix crash of el_insertstr() on incomplete multi-byte


To generate a diff of this commit:
cvs rdiff -u -r1.36 -r1.37 src/lib/libedit/chared.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libedit/chared.c
diff -u src/lib/libedit/chared.c:1.36 src/lib/libedit/chared.c:1.37
--- src/lib/libedit/chared.c:1.36	Sun Oct 23 13:37:55 2011
+++ src/lib/libedit/chared.c	Wed Jul 18 13:12:39 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: chared.c,v 1.36 2011/10/23 17:37:55 christos Exp $	*/
+/*	$NetBSD: chared.c,v 1.37 2012/07/18 17:12:39 christos Exp $	*/
 
 /*-
  * Copyright (c) 1992, 1993
@@ -37,7 +37,7 @@
 #if 0
 static char sccsid[] = "@(#)chared.c	8.1 (Berkeley) 6/4/93";
 #else
-__RCSID("$NetBSD: chared.c,v 1.36 2011/10/23 17:37:55 christos Exp $");
+__RCSID("$NetBSD: chared.c,v 1.37 2012/07/18 17:12:39 christos Exp $");
 #endif
 #endif /* not lint && not SCCSID */
 
@@ -612,7 +612,7 @@ FUN(el,insertstr)(EditLine *el, const Ch
 {
 	size_t len;
 
-	if ((len = Strlen(s)) == 0)
+	if (s == NULL || (len = Strlen(s)) == 0)
 		return -1;
 	if (el->el_line.lastchar + len >= el->el_line.limit) {
 		if (!ch_enlargebufs(el, len))

Reply via email to