Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jan 2020 05:59:22 +0000 (UTC)
From:      Conrad Meyer <cem@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r357249 - head/usr.sbin/ypldap
Message-ID:  <202001290559.00T5xM4I035308@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
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);
 }
 



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001290559.00T5xM4I035308>