From aedab58589432d03cb5addbbf263a73f56f73f05 Mon Sep 17 00:00:00 2001 From: pfg Date: Wed, 8 Jun 2016 19:24:48 +0000 Subject: [PATCH] one-true-awk: Avoid a NULL dereference. CID: 270862 Obtained from: NetBSD (CVS Rev. 1.8) MFC after: 2 weeks --- contrib/one-true-awk/tran.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/one-true-awk/tran.c b/contrib/one-true-awk/tran.c index e364ebd8192..237295af061 100644 --- a/contrib/one-true-awk/tran.c +++ b/contrib/one-true-awk/tran.c @@ -333,7 +333,7 @@ char *setsval(Cell *vp, const char *s) /* set string val of a Cell */ donefld = 0; /* mark $1... invalid */ donerec = 1; } - t = tostring(s); /* in case it's self-assign */ + t = s ? tostring(s) : tostring(""); /* in case it's self-assign */ if (freeable(vp)) xfree(vp->sval); vp->tval &= ~NUM; -- 2.11.4.GIT