Dolda2000 GitWeb
/
icmp-dn.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Take version number from autoconf.
[icmp-dn.git]
/
src
/
idnlookup.c
diff --git
a/src/idnlookup.c
b/src/idnlookup.c
index
c384796
..
b120c52
100644
(file)
--- a/
src/idnlookup.c
+++ b/
src/idnlookup.c
@@
-35,32
+35,7
@@
#include "config.h"
#endif
#include "config.h"
#endif
-struct icmphdr {
- u_int8_t type;
- u_int8_t code;
- u_int16_t checksum;
-};
-
-struct reqhdr {
- u_int8_t type;
- u_int8_t code;
- u_int16_t checksum;
- u_int16_t id;
- u_int16_t seq;
-};
-
-struct rephdr {
- u_int8_t type;
- u_int8_t code;
- u_int16_t checksum;
- u_int16_t id;
- u_int16_t seq;
- int32_t ttl;
-
-};
-
-#define ICMP_NAMEREQ 37
-#define ICMP_NAMEREP 38
+#include "icmpdefs.h"
unsigned char buf[65536];
unsigned char buf[65536];
@@
-78,6
+53,10
@@
void printdn(FILE *f, unsigned char *dnbuf, size_t size, int onlyfirst)
fprintf(stderr, "domain name decompression not implemented, aborting\n");
exit(1);
}
fprintf(stderr, "domain name decompression not implemented, aborting\n");
exit(1);
}
+ if((int)*p + (p - dnbuf) >= size) {
+ fprintf(stderr, "malformed domain name\n");
+ return;
+ }
fprintf(f, "%.*s", (int)*p, p + 1);
p += 1 + (int)*p;
if(*p != 0)
fprintf(f, "%.*s", (int)*p, p + 1);
p += 1 + (int)*p;
if(*p != 0)