File tftp-hpa-0.48-macros-crash.patch of Package tftp.33119

diff -up tftpd/tftpd.c.orig-len tftpd/tftpd.c
--- tftpd/tftpd.c.orig-len	2012-12-11 16:31:29.658043427 +0100
+++ tftpd/tftpd.c	2012-12-11 16:32:22.234018253 +0100
@@ -1287,24 +1287,24 @@ static int rewrite_macros(char macro, ch
             return strlen(p);
 
     case 'x':
-        if (output) {
-            if (from.sa.sa_family == AF_INET) {
+        if (from.sa.sa_family == AF_INET) {
+            if (output)
                 sprintf(output, "%08lX",
                     (unsigned long)ntohl(from.si.sin_addr.s_addr));
-                l = 8;
+            l = 8;
 #ifdef HAVE_IPV6
-            } else {
-                unsigned char *c = (unsigned char *)SOCKADDR_P(&from);
-                p = tb;
-                for (l = 0; l < 16; l++) {
-                    sprintf(p, "%02X", *c);
-                    c++;
-                    p += 2;
-                }
+        } else {
+            unsigned char *c = (unsigned char *)SOCKADDR_P(&from);
+            p = tb;
+            for (l = 0; l < 16; l++) {
+                sprintf(p, "%02X", *c);
+                c++;
+                p += 2;
+            }
+            if (output)
                 strcpy(output, tb);
-                l = strlen(tb);
+            l = strlen(tb);
 #endif
-            }
         }
         return l;
 
openSUSE Build Service is sponsored by