git: cf150bbe650d - stable/12 - Reapply r301691:

Warner Losh imp at FreeBSD.org
Sat Jul 10 17:12:52 UTC 2021


The branch stable/12 has been updated by imp:

URL: https://cgit.FreeBSD.org/src/commit/?id=cf150bbe650db237f94de7331a25e486c0c497c5

commit cf150bbe650db237f94de7331a25e486c0c497c5
Author:     Warner Losh <imp at FreeBSD.org>
AuthorDate: 2019-06-02 20:47:15 +0000
Commit:     Warner Losh <imp at FreeBSD.org>
CommitDate: 2021-07-10 17:11:15 +0000

    Reapply r301691:
    
    Revert r301689 - one-true-awk: Avoid a NULL dereference.
    
    I got this wrong and the coverity report doesn't match the NetBSD change,
    which was thought for a different version.
    
    The change wouldn't hurt but let's wait until upstream figures this out.
    
    (cherry picked from commit 2675e1b91dcfa744a414a42f5522f4fed958476c)
---
 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 8577a0b11d31..837f3742bc4f 100644
--- a/contrib/one-true-awk/tran.c
+++ b/contrib/one-true-awk/tran.c
@@ -366,7 +366,7 @@ char *setsval(Cell *vp, const char *s)	/* set string val of a Cell */
 		if (donerec == 0)
 			recbld();
 	}
-	t = s ? tostring(s) : tostring("");	/* in case it's self-assign */
+	t = tostring(s);	/* in case it's self-assign */
 	if (freeable(vp))
 		xfree(vp->sval);
 	vp->tval &= ~(NUM|CONVC|CONVO);


More information about the dev-commits-src-all mailing list