Wireshark-bugs: [Wireshark-bugs] [Bug 6740] New: OpenBSD compile failure in wiretap/netscaler.c
Date: Sat, 14 Jan 2012 12:46:51 -0800 (PST)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6740

           Summary: OpenBSD compile failure in wiretap/netscaler.c
           Product: Wireshark
           Version: SVN
          Platform: x86-64
        OS/Version: OpenBSD
            Status: NEW
          Severity: Major
          Priority: Low
         Component: Wireshark
        AssignedTo: bugzilla-admin@xxxxxxxxxxxxx
        ReportedBy: njtaylor0101@xxxxxxxxx


Build Information:
wireshark 1.7.1-SVN-40442 (SVN Rev Unknown from unknown)

Copyright 1998-2012 Gerald Combs <gerald@xxxxxxxxxxxxx> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Compiled (64-bit) with GTK+ 3.2.3, with Cairo 1.10.2, with Pango 1.29.4, with
GLib 2.30.2, with libpcap (version unknown), with libz 1.2.3, without POSIX
capabilities, with SMI 0.4.8, with c-ares 1.7.5, with Lua 5.1, with Python
2.7.1, with GnuTLS 2.12.16, with Gcrypt 1.4.6, with Heimdal Kerberos, with
GeoIP, with PortAudio V19-devel (built Dec  9 2011 02:30:18), without AirPcap.

Running on OpenBSD 5.0, without locale, with OpenBSD libpcap, with libz 1.2.3,
GnuTLS 2.12.16, Gcrypt 1.4.6.

--
Patch as follows :

--- wiretap/netscaler.c.orig    Thu Jan 12 15:11:53 2012
+++ wiretap/netscaler.c Sat Jan 14 16:40:06 2012
@@ -159,13 +159,16 @@ typedef   struct nspr_signature_v10
 #define        nspr_signature_v10_s    sizeof(nspr_signature_v10_t)

 /* NSPR_SIGNATURE_V20 structure */
+#define NSPR_SIGSIZE_V20       56      /* signature value size in bytes */
+
+
 typedef        struct nspr_signature_v20
 {
        NSPR_HEADER_V20(sig);   /* short performance header */
        guint8  sig_EndianType; /* Endian Type for the data */
-       gchar   sig_Signature[1]; /* Signature value */
+       gchar   sig_Signature[NSPR_SIGSIZE_V20]; /* Signature value */
 } nspr_signature_v20_t;
-#define        nspr_signature_v20_s    (sizeof(nspr_signature_v20_t) -1)
+#define        nspr_signature_v20_s    (sizeof(nspr_signature_v20_t)
-NSPR_SIGSIZE_V20)

 /* NSPR_ABSTIME_V10 and NSPR_SYSTARTIME_V10 structure */
 typedef        struct nspr_abstime_v10


The OpenBSD compiler checks that the source array boundary isn't exceeded,
using sig_Signature[1] causes the compiler to warn and halt building with an
error in this line

    memcpy(sig20->sig_Signature, NSPR_SIGSTR_V20, sizeof(NSPR_SIGSTR_V20));

a size of 56 has been given NSPR_SIGSIZE_V20 in the same way as
nspr_signature_v10. But could be set to sizeof(NSPR_SIGSTR_V20).

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