Hi,

I've prepared an NMU for this bug, patch is attached below.
It will be uploaded to DELAYED/7.

debdiff amap_4.8-1.dsc amap_4.8-1.1.dsc
 amap-4.8/debian/changelog                |    8 +
 amap-4.8/debian/patches/00list           |    1 
 debian/patches/03_invalid_lvalues.dpatch |  179 +++++++++++++++++++++++++++++++
 3 files changed, 188 insertions(+)

diff -u amap-4.8/debian/changelog amap-4.8/debian/changelog
--- amap-4.8/debian/changelog
+++ amap-4.8/debian/changelog
@@ -1,3 +1,11 @@
+amap (4.8-1.1) unstable; urgency=low
+
+  * Non-maintainer upload.
+  * Apply patch by Andreas Jochens to fix FTBFS with gcc-4.0
+    (Closes: #285090).
+
+ -- Christoph Berg <[EMAIL PROTECTED]>  Thu, 10 Nov 2005 00:48:50 +0100
+
 amap (4.8-1) unstable; urgency=low
 
   * New upstream version.
diff -u amap-4.8/debian/patches/00list amap-4.8/debian/patches/00list
--- amap-4.8/debian/patches/00list
+++ amap-4.8/debian/patches/00list
@@ -2,0 +3 @@
+03_invalid_lvalues
only in patch2:
unchanged:
--- amap-4.8.orig/debian/patches/03_invalid_lvalues.dpatch
+++ amap-4.8/debian/patches/03_invalid_lvalues.dpatch
@@ -0,0 +1,179 @@
+#! /bin/sh -e
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Fixes FTBFS with gcc-4.0.
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+if [ $# -ne 1 ]; then
+    echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+    exit 1
+fi
+case "$1" in
+       -patch) patch $patch_opts -p1 < $0;;
+       -unpatch) patch $patch_opts -p1 -R < $0;;
+        *)
+                echo >&2 "`basename $0`: script expects -patch|-unpatch as 
argument"
+                exit 1;;
+esac
+
+exit 0
[EMAIL PROTECTED]@
+
+diff -urN amap-4.8.orig/amap.c amap-4.8/amap.c
+--- amap-4.8.orig/amap.c
++++ amap-4.8/amap.c
+@@ -424,7 +424,7 @@
+   f = amap_open_file(filename, "trigger", extension, opt->verbose);
+   if (opt->verbose > 1)
+     printf("\n");
+-  if (((amap_struct_triggers*) triggers = (amap_struct_triggers*) trigger = 
(amap_struct_triggers*) malloc(sizeof(amap_struct_triggers))) == NULL)
++  if ((triggers = trigger = (amap_struct_triggers*) 
malloc(sizeof(amap_struct_triggers))) == NULL)
+     amap_error("malloc failed");
+   memset(trigger, 0, sizeof(amap_struct_triggers));
+ 
+@@ -441,7 +441,7 @@
+     if ((line[0] != '#') && (index(line, ':') != NULL) && (only_trigger == 
NULL || strncmp(only_trigger, line, strlen(only_trigger)) == 0)) { // weed out 
comment lines
+       count_triggers++;
+       if (count_triggers > 1) {
+-        if (((amap_struct_triggers*) trigger->next = (amap_struct_triggers*) 
malloc(sizeof(amap_struct_triggers))) == NULL)
++        if ((trigger->next = (amap_struct_triggers*) 
malloc(sizeof(amap_struct_triggers))) == NULL)
+           amap_error("malloc failed");
+         trigger = (amap_struct_triggers*) trigger->next;
+         memset(trigger, 0, sizeof(amap_struct_triggers));
+@@ -599,7 +599,7 @@
+   f = amap_open_file(filename, "response", extension, opt->verbose);
+   if (opt->verbose > 1)
+     printf("\n");
+-  if (((amap_struct_responses*) responses = (amap_struct_responses*) response 
= (amap_struct_responses*) malloc(sizeof(amap_struct_responses))) == NULL)
++  if ((responses = response = (amap_struct_responses*) 
malloc(sizeof(amap_struct_responses))) == NULL)
+     amap_error("malloc failed");
+   memset(response, 0, sizeof(amap_struct_responses));
+ 
+@@ -609,7 +609,7 @@
+     if ((line[0] != '#') && (index(line, ':') != NULL)) { // weed out comment 
lines
+       count_responses++;
+       if (count_responses > 1) {
+-        if (((amap_struct_responses*) response->next = 
(amap_struct_responses*) malloc(sizeof(amap_struct_responses))) == NULL)
++        if ((response->next = (amap_struct_responses*) 
malloc(sizeof(amap_struct_responses))) == NULL)
+           amap_error("malloc failed");
+         response = (amap_struct_responses*) response->next;
+         memset(response, 0, sizeof(amap_struct_responses));
+@@ -644,7 +644,7 @@
+         for (i = 0; i < strlen(triggerptr); i++)
+           if (triggerptr[i] == ',')
+             count++;
+-        if (((amap_struct_triggerptr*) triggerptr_tmp = response->triggerptr 
= malloc(sizeof(amap_struct_triggerptr))) == NULL)
++        if ((triggerptr_tmp = response->triggerptr = 
malloc(sizeof(amap_struct_triggerptr))) == NULL)
+           amap_error("malloc failed");
+         triggerptr_tmp->next = NULL;
+         
+@@ -656,7 +656,7 @@
+           triggerptr_tmp->trigger = strdup(triggerptr);
+           if (i + 1 < count) {
+             triggerptr = ptr;
+-            if (((amap_struct_triggerptr*) triggerptr_tmp->next = 
malloc(sizeof(amap_struct_triggerptr))) == NULL)
++            if ((triggerptr_tmp->next = 
malloc(sizeof(amap_struct_triggerptr))) == NULL)
+               amap_error("malloc failed");
+             triggerptr_tmp = (amap_struct_triggerptr*) triggerptr_tmp->next;
+             triggerptr_tmp->next = NULL;
+@@ -728,7 +728,7 @@
+       if (opt->verbose > 1)
+         printf("%d/%s ", port_tmp->port, port_tmp->ip_prot == AMAP_PROTO_TCP 
? "tcp" : "udp");
+       if (pto != pfrom) {
+-        if (((amap_struct_ports *) port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
++        if ((port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+           amap_error("malloc failed");
+         port_tmp = (amap_struct_ports *) port_tmp->next;
+         memset(port_tmp, 0, sizeof(amap_struct_ports));
+@@ -756,7 +756,7 @@
+   int count = 0;
+ 
+   f = amap_open_file(filename, "nmap", "", opt->verbose);
+-  if (((amap_struct_targets*) targets = (amap_struct_targets*) target = 
(amap_struct_targets*) malloc(sizeof(amap_struct_targets))) == NULL)
++  if ((targets = target = (amap_struct_targets*) 
malloc(sizeof(amap_struct_targets))) == NULL)
+     amap_error("malloc failed");
+   memset(target, 0, sizeof(amap_struct_targets));
+   if ((port_tmp = target->ports = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+@@ -768,7 +768,7 @@
+       amap_error("line in nmap file is too long or not terminating with \\n: 
%s", line);
+     if ((line[0] == 'H') && (index(line, ' ') != NULL) && ((portinfo = 
strstr(line, "/open/")) != NULL)) { // just care for data lines
+       if (count != 0) {
+-        if (((amap_struct_targets*) target->next = (amap_struct_targets*) 
malloc(sizeof(amap_struct_targets))) == NULL)
++        if ((target->next = (amap_struct_targets*) 
malloc(sizeof(amap_struct_targets))) == NULL)
+           amap_error("malloc failed");
+         target = (amap_struct_targets*) target->next;
+         memset(target, 0, sizeof(amap_struct_targets));
+@@ -809,7 +809,7 @@
+       if (opt->verbose > 1)
+         printf("%d/%s ", port_tmp->port, port_tmp->ip_prot == AMAP_PROTO_TCP 
? "tcp" : "udp");
+       while ((portinfo = strstr(proto + 1, "/open/")) != NULL) {
+-        if (((amap_struct_ports *) port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
++        if ((port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+           amap_error("malloc failed");
+         port_tmp = (amap_struct_ports *) port_tmp->next;
+         memset(port_tmp, 0, sizeof(amap_struct_ports));
+@@ -1024,7 +1024,7 @@
+   } else {
+     while (ids->next != NULL)
+       ids = (amap_struct_identifications*) ids->next;
+-    if (((char *) ids->next = malloc(sizeof(amap_struct_identifications))) == 
NULL)
++    if ((ids->next = malloc(sizeof(amap_struct_identifications))) == NULL)
+       amap_error("malloc failed");
+     ids = (amap_struct_identifications*) ids->next;
+   }
+@@ -1765,7 +1765,7 @@
+                   fcntl(s, F_SETFL, O_NONBLOCK);
+                   coms[i].timer = time(NULL);
+                   coms[i].socket = s;
+-                  (char*) coms[i].sockaddr = amap_memdup((char *) &target_in, 
sizeof(target_in));
++                  coms[i].sockaddr = amap_memdup((char *) &target_in, 
sizeof(target_in));
+                   coms[i].sockaddr_len = sizeof(target_in);
+                   scaninfo.running++;
+                   errno = 0;
+@@ -2057,7 +2057,7 @@
+       responses_tmp = (amap_struct_responses*) responses_tmp->next;
+     }
+   } else {
+-    if (((amap_struct_triggers*) triggers = (amap_struct_triggers*) 
malloc(sizeof(amap_struct_triggers))) == NULL)
++    if (( triggers = (amap_struct_triggers*) 
malloc(sizeof(amap_struct_triggers))) == NULL)
+       amap_error("malloc failed");
+     triggers->next = NULL;
+     triggers->id = strdup("NULL");
+@@ -2098,7 +2098,7 @@
+       port_tmp = amap_add_port_string(port_tmp, argv[optind + 1], cmd_proto, 
&opt);
+       i = optind + 2;
+       while (i < argc) {
+-        if (((amap_struct_ports *) port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
++        if ((port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+           amap_error("malloc failed");
+         port_tmp = (amap_struct_ports *) port_tmp->next;
+         memset(port_tmp, 0, sizeof(amap_struct_ports));
+@@ -2110,7 +2110,7 @@
+       while (strcmp(target_tmp->target, argv[optind]) != 0 && 
target_tmp->next != NULL)
+         target_tmp = (amap_struct_targets *) target_tmp->next;
+       if (strcmp(target_tmp->target, argv[optind]) != 0) { // it is not
+-        if (((amap_struct_targets *) target_tmp->next = (amap_struct_targets 
*) malloc(sizeof(amap_struct_targets))) == NULL)
++        if ((target_tmp->next = (amap_struct_targets *) 
malloc(sizeof(amap_struct_targets))) == NULL)
+           amap_error("malloc failed");
+         target_tmp = (amap_struct_targets *) target_tmp->next;
+         memset(target_tmp, 0, sizeof(amap_struct_targets));
+@@ -2125,7 +2125,7 @@
+           printf("%d/%s ", port_tmp->port, port_tmp->ip_prot == 
AMAP_PROTO_TCP ? "tcp" : "udp");
+         i = optind + 2;
+         while (i < argc) {
+-          if (((amap_struct_ports *) port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
++          if ((port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+             amap_error("malloc failed");
+           port_tmp = (amap_struct_ports *) port_tmp->next;
+           memset(port_tmp, 0, sizeof(amap_struct_ports));
+@@ -2155,7 +2155,7 @@
+             while (((port_tmp->ip_prot != cmd_proto) || (port_tmp->port != 
(unsigned short int) pfrom)) && port_tmp->next != NULL)
+               port_tmp = (amap_struct_ports *) port_tmp->next;
+             if (port_tmp->port != (unsigned short int) pfrom) { // we have to 
add the port
+-              if (((amap_struct_ports *) port_tmp->next = (amap_struct_ports 
*) malloc(sizeof(amap_struct_ports))) == NULL)
++              if ((port_tmp->next = (amap_struct_ports *) 
malloc(sizeof(amap_struct_ports))) == NULL)
+                 amap_error("malloc failed");
+               port_tmp = (amap_struct_ports *) port_tmp->next;
+               memset(port_tmp, 0, sizeof(amap_struct_ports));

Christoph
-- 
[EMAIL PROTECTED] | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to