mirror of
https://github.com/yarrick/iodine.git
synced 2024-11-22 16:19:20 +02:00
Fix strange jump issue
This commit is contained in:
parent
aeae642fd8
commit
3f0dbf5ce5
4
read.c
4
read.c
|
@ -24,7 +24,7 @@ readname_loop(char *packet, int packetlen, char **src, char *dst, size_t length,
|
||||||
char *s;
|
char *s;
|
||||||
char *d;
|
char *d;
|
||||||
int len;
|
int len;
|
||||||
unsigned offset;
|
int offset;
|
||||||
char c;
|
char c;
|
||||||
|
|
||||||
if (loop <= 0)
|
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? */
|
/* is this a compressed label? */
|
||||||
if((c & 0xc0) == 0xc0) {
|
if((c & 0xc0) == 0xc0) {
|
||||||
offset = (((s[-1] & 0x3f) << 8) | s[0]);
|
offset = (((s[-1] & 0x3f) << 8) | (s[0] & 0xff));
|
||||||
if (offset > packetlen) {
|
if (offset > packetlen) {
|
||||||
if (len == 0) {
|
if (len == 0) {
|
||||||
// Bad jump first in packet
|
// Bad jump first in packet
|
||||||
|
|
Loading…
Reference in New Issue