Package: lookup
Version: 1.08b-9
Followup-For: Bug #320722

xmalloc is responsible for the segfault, i have rewritten the functino
to be more readable, and more modern. patch tested.

-- System Information:
Debian Release: testing/unstable
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12.2
Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15)

Versions of packages lookup depends on:
ii  libc6                       2.3.2.ds1-22 GNU C Library: Shared libraries an

lookup recommends no packages.

-- no debconf information
diff -u lookup-1.08b/debian/rules lookup-1.08b/debian/rules
--- lookup-1.08b/debian/rules
+++ lookup-1.08b/debian/rules
@@ -8,7 +8,7 @@
 # This is the debhelper compatability version to use.
 export DH_COMPAT=2
 
-export CFLAGS := -Wall -g
+export CFLAGS := -Wall -g -DUSE_VSNPRINTF
 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
     CFLAGS += -O0
 else
diff -u lookup-1.08b/debian/changelog lookup-1.08b/debian/changelog
--- lookup-1.08b/debian/changelog
+++ lookup-1.08b/debian/changelog
@@ -1,3 +1,9 @@
+lookup (1.08b-9.luc0) unstable; urgency=low
+
+  * Fix segfault on amd64
+
+ -- Luc Saillard <[EMAIL PROTECTED]>  Sun,  7 Aug 2005 11:12:27 +0200
+
 lookup (1.08b-9) unstable; urgency=low
 
   * FTBFS on amd64/gcc-4.0. Patch added. Closes: #284901
only in patch2:
unchanged:
--- lookup-1.08b.orig/lib/xmalloc.c
+++ lookup-1.08b/lib/xmalloc.c
@@ -1,18 +1,19 @@
 #include "xmalloc.h"
 
-#undef xmalloc
+#include <stdio.h>
+#include <stdlib.h>
 
 /*
  * like malloc(), but dies if memory not available.
  */
-void *xmalloc(unsigned len)
+void *xmalloc(unsigned int len)
 {
     void *ptr;
-    if (ptr = (void *)malloc(len), ptr == 0)
+    ptr = malloc(len);
+    if (ptr == NULL)
     {
-        #define MSG "<out of memory in malloc>\n"
-       write(2, MSG, sizeof(MSG)-1);
-       exit(3);
+      fprintf(stderr, "<out of memory in malloc>\n");
+      exit(3);
     }
     return ptr;
 }
--- lookup-1.08b.orig/lib/xmalloc.c
+++ lookup-1.08b/lib/xmalloc.c
@@ -1,18 +1,19 @@
 #include "xmalloc.h"
 
-#undef xmalloc
+#include <stdio.h>
+#include <stdlib.h>
 
 /*
  * like malloc(), but dies if memory not available.
  */
-void *xmalloc(unsigned len)
+void *xmalloc(unsigned int len)
 {
     void *ptr;
-    if (ptr = (void *)malloc(len), ptr == 0)
+    ptr = malloc(len);
+    if (ptr == NULL)
     {
-        #define MSG "<out of memory in malloc>\n"
-	write(2, MSG, sizeof(MSG)-1);
-	exit(3);
+      fprintf(stderr, "<out of memory in malloc>\n");
+      exit(3);
     }
     return ptr;
 }

Reply via email to