From 190af08cf37d9e3ef84ed9e65660d702e2082d70 Mon Sep 17 00:00:00 2001 From: wiz Date: Mon, 24 Sep 2001 13:22:25 +0000 Subject: va_{start,end} audit: Make sure that each va_start has one and only one matching va_end, especially in error cases. If the va_list is used multiple times, do multiple va_starts/va_ends. If a function gets va_list as argument, don't let it use va_end (since it's the callers responsibility). Improved by comments from enami and christos -- thanks! Heimdal/krb4/KAME changes already fed back, rest to follow. Inspired by, but not not based on, OpenBSD. --- larn/io.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'larn/io.c') diff --git a/larn/io.c b/larn/io.c index b9f963fa..c7233271 100644 --- a/larn/io.c +++ b/larn/io.c @@ -1,4 +1,4 @@ -/* $NetBSD: io.c,v 1.11 2001/02/05 00:57:33 christos Exp $ */ +/* $NetBSD: io.c,v 1.12 2001/09/24 13:22:29 wiz Exp $ */ /* * io.c Larn is copyrighted 1986 by Noah Morgan. @@ -62,7 +62,7 @@ */ #include #ifndef lint -__RCSID("$NetBSD: io.c,v 1.11 2001/02/05 00:57:33 christos Exp $"); +__RCSID("$NetBSD: io.c,v 1.12 2001/09/24 13:22:29 wiz Exp $"); #endif /* not lint */ #include "header.h" @@ -278,6 +278,7 @@ va_dcl *outb++ = *fmt++; else { lpnt = outb; + va_end(ap); return; } wide = 0; -- cgit v1.2.3