svn commit: r357249 - head/usr.sbin/ypldap
Conrad Meyer
cem at FreeBSD.org
Wed Jan 29 05:59:23 UTC 2020
Author: cem
Date: Wed Jan 29 05:59:22 2020
New Revision: 357249
URL: https://svnweb.freebsd.org/changeset/base/357249
Log:
ypldap(8): Fix absent va_end() in 'goto fail' path
In this path, we used va_start() without pairing it with va_end(). Add the
va_end(). (va_start() without paired va_end() is undefined behavior per the C
standard.)
"In many implementations, [va_end] is a do-nothing operation; but those
implementations that need it probably need it badly." - Rationale for the ANSI
C Programming Language, § 4.8.1.3.
Reported by: Coverity
CID: 1340539
Modified:
head/usr.sbin/ypldap/ber.c
Modified: head/usr.sbin/ypldap/ber.c
==============================================================================
--- head/usr.sbin/ypldap/ber.c Wed Jan 29 05:42:24 2020 (r357248)
+++ head/usr.sbin/ypldap/ber.c Wed Jan 29 05:59:22 2020 (r357249)
@@ -621,6 +621,7 @@ ber_printf_elements(struct ber_element *ber, char *fmt
return (ber);
fail:
+ va_end(ap);
return (NULL);
}
More information about the svn-src-all
mailing list