blob: 600530ac571afe137ce5d0d966009c74a643f7f2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
|
$NetBSD: patch-aa,v 1.6 2009/07/27 12:59:44 obache Exp $
Check if sp is a null pointer before parsing it.
--- src/fe-text/tparm.c.orig 2007-10-06 10:40:39.000000000 +0100
+++ src/fe-text/tparm.c
@@ -247,7 +247,7 @@ char *tparm(const char *str, ...) {
argcnt = 0;
pos = 0;
termcap = 1;
- while (*sp != '\0') {
+ while ((sp != NULL) && (*sp != '\0')) {
switch(*sp) {
case '\\':
if (scan_for) {
|