summaryrefslogtreecommitdiff
path: root/cups/options.c
diff options
context:
space:
mode:
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-01-17 00:06:33 +0000
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>2008-01-17 00:06:33 +0000
commit91c84a3551145559de2956179661e111e373db95 (patch)
treeea061b2b6ab3b9e4530347e35f5cde3511f8a305 /cups/options.c
parent080811b190031b9182e96dc76fc610fadfeaec21 (diff)
Import CUPS 1.4svn-r7226.
git-svn-id: svn+ssh://src.apple.com/svn/cups/easysw/current@582 a1ca3aef-8c08-0410-bb20-df032aa958be
Diffstat (limited to 'cups/options.c')
-rw-r--r--cups/options.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/cups/options.c b/cups/options.c
index b0d703e63..f04138497 100644
--- a/cups/options.c
+++ b/cups/options.c
@@ -3,7 +3,7 @@
*
* Option routines for the Common UNIX Printing System (CUPS).
*
- * Copyright 2007 by Apple Inc.
+ * Copyright 2007-2008 by Apple Inc.
* Copyright 1997-2007 by Easy Software Products.
*
* These coded instructions, statements, and computer programs are the
@@ -473,15 +473,24 @@ cupsParseOptions(
*value; /* Pointer to value */
- if (arg == NULL || options == NULL || num_options < 0)
+ /*
+ * Range check input...
+ */
+
+ if (!arg)
+ return (num_options);
+
+ if (!options || num_options < 0)
return (0);
/*
* Make a copy of the argument string and then divide it up...
*/
- copyarg = strdup(arg);
- ptr = copyarg;
+ if ((copyarg = strdup(arg)) == NULL)
+ return (num_options);
+
+ ptr = copyarg;
/*
* Skip leading spaces...