diff options
author | 2013-11-26 09:12:04 +0000 | |
---|---|---|
committer | 2013-11-26 09:12:04 +0000 | |
commit | b80ec9eafa2dceec01270fadc6d692cf5c54f8d5 (patch) | |
tree | 08fd7045292c494d0ed8039078d35846b40ffc86 | |
parent | claim to support relaxed fencing (diff) | |
download | wireguard-openbsd-b80ec9eafa2dceec01270fadc6d692cf5c54f8d5.tar.xz wireguard-openbsd-b80ec9eafa2dceec01270fadc6d692cf5c54f8d5.zip |
fix incorrectly converted CIRCLEQ_END comparison to prevent NULL deref's
found by clang static analyzer, ok jca, otto
-rw-r--r-- | usr.bin/vi/vi/v_txt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/vi/vi/v_txt.c b/usr.bin/vi/vi/v_txt.c index 0e26ef2aafc..7f98cc54cbc 100644 --- a/usr.bin/vi/vi/v_txt.c +++ b/usr.bin/vi/vi/v_txt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: v_txt.c,v 1.24 2013/11/25 23:27:11 krw Exp $ */ +/* $OpenBSD: v_txt.c,v 1.25 2013/11/26 09:12:04 pelikan Exp $ */ /*- * Copyright (c) 1993, 1994 @@ -1844,7 +1844,7 @@ txt_backup(sp, tiqh, tp, flagsp) TEXT *ntp; /* Get a handle on the previous TEXT structure. */ - if ((ntp = TAILQ_PREV(tp, _texth, q))) { + if ((ntp = TAILQ_PREV(tp, _texth, q)) == NULL) { if (!FL_ISSET(*flagsp, TXT_REPLAY)) msgq(sp, M_BERR, "193|Already at the beginning of the insert"); |