[PATCH] Check for NULL on option string (v1.1.0)
"Allan N. Snider" <[email protected]> Tue, 03 Feb 2009 15:13:12 -0500
| Newsgroups | gmane.comp.video.transcode.devel |
|---|---|
| Message-ID | <[email protected]> |
This patch didn't make it into 1.1.0. It adds a check for NULL when
parsing arguments. This allows default values to be assumed when
arguments are missing.
Allan
libtc_optstr_null.patch
(text/plain, 309 B)
diff -ru old/libtc/optstr.c new/libtc/optstr.c
--- old/libtc/optstr.c 2007-03-03 15:10:40.000000000 -0500
+++ new/libtc/optstr.c 2009-01-27 00:39:39.000000000 -0500
@@ -117,6 +117,9 @@
if( *ch == '=' )
ch++;
+ if( !*ch )
+ return 0;
+
va_start(ap, fmt);
#ifndef HAVE_VSSCANF