Avoid passing a NULL string pointer to format routines: some libc's (e.g.,
authormorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 Apr 2011 18:32:56 +0000 (18:32 +0000)
committermorriss <morriss@f5534014-38df-0310-8fa8-9805f1628bb7>
Fri, 22 Apr 2011 18:32:56 +0000 (18:32 +0000)
Solaris') will seg-fault on that.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36827 f5534014-38df-0310-8fa8-9805f1628bb7

epan/dissectors/packet-rpc.c

index 40c272e4b179d1703370aa73ea088b24cf481c9e..d1085758b8f331c67834baf7cd4af61fb21e478f 100644 (file)
@@ -1643,7 +1643,7 @@ dissect_rpc_continuation(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
  *  and version values.
  */
 
-static void 
+static void
 make_fake_rpc_prog_if_needed (rpc_prog_info_key *prpc_prog_key, guint prog_ver)
 {
        /* sanity check: no one uses versions > 10 */
@@ -2245,6 +2245,10 @@ dissect_rpc_message(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                        procname = (char *)match_strval(gss_proc, rpc_authgssapi_proc);
                }
 
+               /* Don't pass NULL string pointers to the format routines below */
+               if (!procname)
+                       procname = "(null)";
+
                rpc_prog_key.prog = prog;
                if ((rpc_prog = g_hash_table_lookup(rpc_progs,&rpc_prog_key)) == NULL) {
                        proto = NULL;