lib:util: Fix DEBUGCLASS pointer initializiation
authorAndreas Schneider <asn@samba.org>
Wed, 7 Nov 2018 13:32:29 +0000 (14:32 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 8 Nov 2018 07:07:10 +0000 (08:07 +0100)
This fixes a segfault in pyglue:

==10142== Process terminating with default action of signal 11 (SIGSEGV)
==10142==  Bad permissions for mapped region at address 0x6F00A20
==10142==    at 0x6F1074B: py_set_debug_level (pyglue.c:165)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13679

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
lib/util/debug.c

index d41e0f99c7703e0498a5929749c7f16f49462459..847ec1f0a0c298eda6c14e32c358d9bd724540cc 100644 (file)
@@ -557,10 +557,10 @@ static const char *default_classname_table[] = {
  * This is to allow reading of DEBUGLEVEL_CLASS before the debug
  * system has been initialized.
  */
-static const int debug_class_list_initial[ARRAY_SIZE(default_classname_table)];
+static int debug_class_list_initial[ARRAY_SIZE(default_classname_table)];
 
 static size_t debug_num_classes = 0;
-int     *DEBUGLEVEL_CLASS = discard_const_p(int, debug_class_list_initial);
+int     *DEBUGLEVEL_CLASS = debug_class_list_initial;
 
 
 /* -------------------------------------------------------------------------- **