Project

General

Profile

Actions

Bug #1823

closed

Bug #1450: Illumos should be buildable with GCC4

smb der parser should cast to unsigned char when expecting it

Added by Rich Lowe over 11 years ago. Updated over 11 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
Category:
lib - userland libraries
Start date:
2011-11-27
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:
External Bug:

Description

in derparser.c the OID types are explicitly unsigned char*, we need to cast even when assigning literals to appease GCC4.

diff --git a/usr/src/lib/libsmbfs/smb/derparse.c b/usr/src/lib/libsmbfs/smb/derparse.c
index 0180e06..f92da91 100644
--- a/usr/src/lib/libsmbfs/smb/derparse.c
+++ b/usr/src/lib/libsmbfs/smb/derparse.c
@@ -37,15 +37,16 @@
 #pragma error_messages (off,E_INITIALIZATION_TYPE_MISMATCH)
 MECH_OID g_stcMechOIDList [] =
 {
-    {"\x06\x09\x2a\x86\x48\x82\xf7\x12\x01\x02\x02",    11,  9,
-     spnego_mech_oid_Kerberos_V5_Legacy    },    // 1.2.840.48018.1.2.2 
-    {"\x06\x09\x2a\x86\x48\x86\xf7\x12\x01\x02\x02",    11,  9,
-     spnego_mech_oid_Kerberos_V5        }, // 1.2.840.113554.1.2.2
-    {"\x06\x06\x2b\x06\x01\x05\x05\x02",             8,  6,
-     spnego_mech_oid_Spnego            }, // 1.3.6.1.5.5.2
-    {"\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a",    12, 10,
-     spnego_mech_oid_NTLMSSP        }, // 1.3.6.1.4.1.311.2.2.10
-    {"", 0,  0, spnego_mech_oid_NotUsed    }  // Placeholder
+        {(unsigned char *)"\x06\x09\x2a\x86\x48\x82\xf7\x12\x01\x02\x02",
+         11,  9, spnego_mech_oid_Kerberos_V5_Legacy},    // 1.2.840.48018.1.2.2 
+    {(unsigned char *)"\x06\x09\x2a\x86\x48\x86\xf7\x12\x01\x02\x02",
+         11,  9, spnego_mech_oid_Kerberos_V5}, // 1.2.840.113554.1.2.2
+    {(unsigned char *)"\x06\x06\x2b\x06\x01\x05\x05\x02",
+         8,  6, spnego_mech_oid_Spnego}, // 1.3.6.1.5.5.2
+    {(unsigned char *)"\x06\x0a\x2b\x06\x01\x04\x01\x82\x37\x02\x02\x0a",
+         12, 10, spnego_mech_oid_NTLMSSP}, // 1.3.6.1.4.1.311.2.2.10
+    {(unsigned char *)"", 0,  0, spnego_mech_oid_NotUsed  // Placeholder
+        }
 };
 #pragma error_messages (default,E_INITIALIZATION_TYPE_MISMATCH)
 

As Gordon points out, note the #pragma for whatever other compiler.

Actions

Also available in: Atom PDF