Ethereal-dev: [Ethereal-dev] [PATCH] fix for bug 742

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Paolo Abeni <paolo.abeni@xxxxxxxx>
Date: Wed, 15 Feb 2006 20:35:48 +0100
hi all,

the attached patch should fix bug 742.

The issue is (at least, I think so...) in the packet-x509af dissector
A null pointer is passes as parameter of a " %s " format string. Something like:

printf("%s", NULL);

it does not hurt under linux and is fatal under windows.

Best regards,

Paolo



--
Email.it, the professional e-mail, gratis per te: http://www.email.it/f

Sponsor:
 Vuoi bere tanta acqua pura e risparmiare ben 495 euro all'anno?
* Con BeviSano avrai finito di comprare acqua in bottiglia - clicca qui Clicca qui: http://adv.email.it/cgi-bin/foclick.cgi?mid=3628&d=15-2
Index: epan/dissectors/packet-x509af.c
===================================================================
--- epan/dissectors/packet-x509af.c	(revision 17307)
+++ epan/dissectors/packet-x509af.c	(working copy)
@@ -426,16 +426,16 @@
 static int
 dissect_x509af_SubjectName(gboolean implicit_tag _U_, tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree, int hf_index _U_) {
 #line 112 "x509af.cnf"
-
-    offset = dissect_ber_choice(pinfo, tree, tvb, offset,
+  char * str;
+  offset = dissect_ber_choice(pinfo, tree, tvb, offset,
                                  SubjectName_choice, hf_index, ett_x509af_SubjectName,
                                  NULL);
 
+  str = x509if_get_last_dn();
+  proto_item_append_text(proto_item_get_parent(tree), " (%s)", str?str:"");
 
-  proto_item_append_text(proto_item_get_parent(tree), " (%s)", x509if_get_last_dn());
 
 
-
   return offset;
 }
 static int dissect_subject(packet_info *pinfo, proto_tree *tree, tvbuff_t *tvb, int offset) {