Fix strange jump issue

This commit is contained in:
Erik Ekman 2006-11-07 10:07:53 +00:00
parent aeae642fd8
commit 3f0dbf5ce5

4
read.c
View file

@ -24,7 +24,7 @@ readname_loop(char *packet, int packetlen, char **src, char *dst, size_t length,
char *s;
char *d;
int len;
unsigned offset;
int offset;
char c;
if (loop <= 0)
@ -38,7 +38,7 @@ readname_loop(char *packet, int packetlen, char **src, char *dst, size_t length,
/* is this a compressed label? */
if((c & 0xc0) == 0xc0) {
offset = (((s[-1] & 0x3f) << 8) | s[0]);
offset = (((s[-1] & 0x3f) << 8) | (s[0] & 0xff));
if (offset > packetlen) {
if (len == 0) {
// Bad jump first in packet