]> git.michaelhowe.org Git - packages/o/openafs.git/commitdiff
rxgen: Fix NULL pointer dereference
authorSimon Wilkinson <sxw@your-file-system.com>
Fri, 15 Feb 2013 16:05:33 +0000 (16:05 +0000)
committerStephan Wiesand <stephan.wiesand@desy.de>
Mon, 25 Mar 2013 13:33:35 +0000 (06:33 -0700)
Avoid a NULL pointer dereference if strchr doesn't find any occurence
of '*' in the string. Whilst we handle the not found case when inserting
a mid string terminator, we don't handle it when restoring the string to
its previous value.

Reviewed-on: http://gerrit.openafs.org/9158
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
(cherry picked from commit 0d28f8c0cec91d68023795e6ba9c769d60869f9e)

Change-Id: I6eb3ec5647153e588c5a80025da2bf2c921469b3
Reviewed-on: http://gerrit.openafs.org/9525
Tested-by: BuildBot <buildbot@rampaginggeek.com>
Reviewed-by: Derrick Brashear <shadow@your-file-system.com>
Reviewed-by: Andrew Deason <adeason@sinenomine.net>
Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
Reviewed-by: Stephan Wiesand <stephan.wiesand@desy.de>
src/rxgen/rpc_parse.c

index a19ca5489c5578a821eb256090ca8c840d7f217f..8ce005d90603434ba259d5f0b2892f0a112c58a7 100644 (file)
@@ -1424,7 +1424,8 @@ ss_ProcParams_setup(definition * defp, int *somefrees)
                }
                f_print(fout, "\t%s %s", plist->pl.param_type,
                        plist->pl.param_name);
-               *pntr = pres;
+               if (pntr)
+                   *pntr = pres;
            } else if (strchr(plist->pl.param_type, '*') == 0) {
                f_print(fout, "\t%s %s", plist->pl.param_type,
                        plist->pl.param_name);