diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-06-08 19:24:48 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2016-06-08 19:24:48 +0000 |
commit | 17ce5a9b90ea641cf433857664ee6702b4152539 (patch) | |
tree | 57c56637c8348f9b27f457125bc3d379cbda2ef8 /contrib/one-true-awk/tran.c | |
parent | cadd473c5249f5ec87508850e42ed6b1e3fd58fa (diff) | |
download | src-17ce5a9b90ea641cf433857664ee6702b4152539.tar.gz src-17ce5a9b90ea641cf433857664ee6702b4152539.zip |
one-true-awk: Avoid a NULL dereference.
CID: 270862
Obtained from: NetBSD (CVS Rev. 1.8)
MFC after: 2 weeks
Notes
Notes:
svn path=/head/; revision=301689
Diffstat (limited to 'contrib/one-true-awk/tran.c')
-rw-r--r-- | contrib/one-true-awk/tran.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/one-true-awk/tran.c b/contrib/one-true-awk/tran.c index e364ebd81928..237295af0611 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; |