ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
April 17th, 2024 | 14:30-16:00 SGT (UTC+8) | Online

Wireshark-bugs: [Wireshark-bugs] [Bug 3937] trunk code compiling error(warnings)

Date: Wed, 26 Aug 2009 06:38:11 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3937





--- Comment #3 from dragonlinux@xxxxxxxxx  2009-08-26 06:38:10 PDT ---
I fixed it like this:

Index: dissectors/packet-ssl-utils.c
===================================================================
--- dissectors/packet-ssl-utils.c       (revision 29538)
+++ dissectors/packet-ssl-utils.c       (working copy)
@@ -1853,7 +1853,9 @@
     gint md;
     guint32 len;
     guint8 buf[20];
+    guint16 *pbuf;

+    pbuf = (guint16*)buf;
     md=ssl_get_digest_by_name(digests[decoder->cipher_suite->dig-0x40]);
     ssl_debug_printf("tls_check_mac mac type:%s md %d\n",
         digests[decoder->cipher_suite->dig-0x40], md);
@@ -1873,10 +1875,11 @@
     ssl_hmac_update(&hm,buf,1);

     /* hash version,data length and data*/
-    *((gint16*)buf) = g_htons(ver);
+    /**((guint16*)buf) = g_htons(ver);*/
+    *pbuf = g_htons(ver);
     ssl_hmac_update(&hm,buf,2);

-    *((gint16*)buf) = g_htons(datalen);
+    *pbuf = g_htons(datalen);
     ssl_hmac_update(&hm,buf,2);
     ssl_hmac_update(&hm,data,datalen);

@@ -1899,7 +1902,9 @@
     guint32 len;
     guint8 buf[64],dgst[20];
     gint pad_ct;
+    guint16 *pbuf;

+    pbuf = (guint16*)buf;
     pad_ct=(decoder->cipher_suite->dig==DIG_SHA)?40:48;

     /* get cipher used for digest comptuation */
@@ -1924,7 +1929,7 @@
     ssl_md_update(&mc,buf,1);

     /* hash data length in network byte order and data*/
-    *((gint16* )buf) = g_htons(datalen);
+    *pbuf = g_htons(datalen);
     ssl_md_update(&mc,buf,2);
     ssl_md_update(&mc,data,datalen);




for the hf_entr.hfinfo I didn't understand why code is initializing each field
one by one, but not a memeset? then initialize what you want.


-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.