6ed84f
Resolves: #1485943
6ed84f
6ed84f
--- a/tftpd/tftpd.c       2017-08-28 09:12:11.681299000 +0200
6ed84f
+++ b/tftpd/tftpd.c       2017-08-28 13:30:03.109312000 +0200
6ed84f
@@ -1388,24 +1388,25 @@
6ed84f
             return strlen(p);
6ed84f
 
6ed84f
     case 'x':
6ed84f
-        if (output) {
6ed84f
-            if (from.sa.sa_family == AF_INET) {
6ed84f
+        if (from.sa.sa_family == AF_INET) {
6ed84f
+            if (output) {
6ed84f
                 sprintf(output, "%08lX",
6ed84f
                     (unsigned long)ntohl(from.si.sin_addr.s_addr));
6ed84f
-                l = 8;
6ed84f
+            }
6ed84f
+            l = 8;
6ed84f
 #ifdef HAVE_IPV6
6ed84f
-            } else {
6ed84f
-                unsigned char *c = (unsigned char *)SOCKADDR_P(&from;;
6ed84f
-                p = tb;
6ed84f
-                for (l = 0; l < 16; l++) {
6ed84f
-                    sprintf(p, "%02X", *c);
6ed84f
-                    c++;
6ed84f
-                    p += 2;
6ed84f
-                }
6ed84f
+        } else {
6ed84f
+            unsigned char *c = (unsigned char *)SOCKADDR_P(&from;;
6ed84f
+            p = tb;
6ed84f
+            for (l = 0; l < 16; l++) {
6ed84f
+                sprintf(p, "%02X", *c);
6ed84f
+                c++;
6ed84f
+                p += 2;
6ed84f
+            }
6ed84f
+            if (output)
6ed84f
                 strcpy(output, tb);
6ed84f
-                l = strlen(tb);
6ed84f
+            l = strlen(tb);
6ed84f
 #endif
6ed84f
-            }
6ed84f
         }
6ed84f
         return l;
6ed84f
 
6ed84f