Daily patch: gateway

kannel at kannel.org kannel at kannel.org
Thu Nov 10 06:30:02 CET 2011


Index: gwlib/octstr.c.debug
===================================================================
--- gwlib/octstr.c.debug	(revision 4939)
+++ gwlib/octstr.c.debug	(revision 4940)
@@ -70,7 +70,7 @@
  * and discarding the lowest to bits to get rid of typical alignment
  * bits.
  */
-#define CSTR_TO_LONG(ptr)	(((long) ptr) >> 2)
+#define CSTR_TO_LONG(ptr)	(((unsigned long) ptr) >> 2)
 
 /***********************************************************************
  * Declarations of internal functions. These are defined at the end of
Index: gwlib/octstr.c
===================================================================
--- gwlib/octstr.c	(revision 4939)
+++ gwlib/octstr.c	(revision 4940)
@@ -142,7 +142,7 @@
  * and discarding the lowest to bits to get rid of typical alignment
  * bits.
  */
-#define CSTR_TO_LONG(ptr)	(((long) ptr) >> 2)
+#define CSTR_TO_LONG(ptr)	(((unsigned long) ptr) >> 2)
 
 
 /*
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4939)
+++ ChangeLog	(revision 4940)
@@ -1,3 +1,8 @@
+2011-11-09 Alexander Malysh <amalysh at kannel.org>
+    * gwlib/octstr.c, gwlib/octstr.c.debug: fixed segfault on some systems where
+      long overflow occurs. This fixes #623.
+      Thanks to Lutalo Joseph Willrich for patch.
+
 2011-10-31 Alexander Malysh <amalysh at kannel.org>
     * reverted commited that moved .foreign_id injection from dlr_add() because
       it breaks other SMSC module as SMPP.






More information about the devel-reports mailing list