summaryrefslogtreecommitdiffstats
path: root/source3/web/cgi.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-06-20 19:21:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:18:53 -0500
commit4340b7cea74203799f7cd5d2457cbe062b42425c (patch)
treecc16c5f3ce3f258acbe48f2760216685ae204891 /source3/web/cgi.c
parentf014291edda9449c73757063fc306d564445cc18 (diff)
downloadsamba-4340b7cea74203799f7cd5d2457cbe062b42425c.tar.gz
samba-4340b7cea74203799f7cd5d2457cbe062b42425c.tar.xz
samba-4340b7cea74203799f7cd5d2457cbe062b42425c.zip
r16426: Klocwork #1544, #1545, #1546, #1549, #1550, #1552, #1553, #1554
Jeremy. (This used to be commit e71cc6647a2eaba0eac95b6abb40745e45db72a4)
Diffstat (limited to 'source3/web/cgi.c')
-rw-r--r--source3/web/cgi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/source3/web/cgi.c b/source3/web/cgi.c
index b764b6d6283..d289613b4ba 100644
--- a/source3/web/cgi.c
+++ b/source3/web/cgi.c
@@ -223,6 +223,7 @@ void cgi_load_variables(void)
browser. Also doesn't allow for variables[] containing multiple variables
with the same name and the same or different values.
***************************************************************************/
+
const char *cgi_variable(const char *name)
{
int i;
@@ -234,6 +235,20 @@ const char *cgi_variable(const char *name)
}
/***************************************************************************
+ Version of the above that can't return a NULL pointer.
+***************************************************************************/
+
+const char *cgi_variable_nonull(const char *name)
+{
+ const char *var = cgi_variable(name);
+ if (var) {
+ return var;
+ } else {
+ return "";
+ }
+}
+
+/***************************************************************************
tell a browser about a fatal error in the http processing
***************************************************************************/
static void cgi_setup_error(const char *err, const char *header, const char *info)