tftp/tftp-hpa-0.48-macros-crash.patch

47 lines
1.4 KiB
Diff

---
tftpd/tftpd.c | 26 +++++++++++++-------------
1 file changed, 13 insertions(+), 13 deletions(-)
Index: tftp-hpa-5.2/tftpd/tftpd.c
===================================================================
--- tftp-hpa-5.2.orig/tftpd/tftpd.c
+++ tftp-hpa-5.2/tftpd/tftpd.c
@@ -1377,24 +1377,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;