mirror of
https://github.com/samba-team/samba.git
synced 2025-01-08 21:18:16 +03:00
Rename BAD to BAD_DATA since the first is already defined on SunOS.
This commit is contained in:
parent
620a27bdf1
commit
68bb6e56ba
@ -309,7 +309,7 @@ void FAR *out_desc;
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
strm->msg = "invalid block type";
|
strm->msg = "invalid block type";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
}
|
}
|
||||||
DROPBITS(2);
|
DROPBITS(2);
|
||||||
break;
|
break;
|
||||||
@ -320,7 +320,7 @@ void FAR *out_desc;
|
|||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
strm->msg = "invalid stored block lengths";
|
strm->msg = "invalid stored block lengths";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->length = (unsigned)hold & 0xffff;
|
state->length = (unsigned)hold & 0xffff;
|
||||||
@ -358,7 +358,7 @@ void FAR *out_desc;
|
|||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
strm->msg = "too many length or distance symbols";
|
strm->msg = "too many length or distance symbols";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -380,7 +380,7 @@ void FAR *out_desc;
|
|||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid code lengths set";
|
strm->msg = "invalid code lengths set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracev((stderr, "inflate: code lengths ok\n"));
|
Tracev((stderr, "inflate: code lengths ok\n"));
|
||||||
@ -404,7 +404,7 @@ void FAR *out_desc;
|
|||||||
DROPBITS(this.bits);
|
DROPBITS(this.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
strm->msg = "invalid bit length repeat";
|
strm->msg = "invalid bit length repeat";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
len = (unsigned)(state->lens[state->have - 1]);
|
len = (unsigned)(state->lens[state->have - 1]);
|
||||||
@ -427,7 +427,7 @@ void FAR *out_desc;
|
|||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
strm->msg = "invalid bit length repeat";
|
strm->msg = "invalid bit length repeat";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (copy--)
|
while (copy--)
|
||||||
@ -436,7 +436,7 @@ void FAR *out_desc;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* handle error breaks in while */
|
/* handle error breaks in while */
|
||||||
if (state->mode == BAD) break;
|
if (state->mode == BAD_DATA) break;
|
||||||
|
|
||||||
/* build code tables */
|
/* build code tables */
|
||||||
state->next = state->codes;
|
state->next = state->codes;
|
||||||
@ -446,7 +446,7 @@ void FAR *out_desc;
|
|||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid literal/lengths set";
|
strm->msg = "invalid literal/lengths set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->distcode = (code const FAR *)(state->next);
|
state->distcode = (code const FAR *)(state->next);
|
||||||
@ -455,7 +455,7 @@ void FAR *out_desc;
|
|||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid distances set";
|
strm->msg = "invalid distances set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracev((stderr, "inflate: codes ok\n"));
|
Tracev((stderr, "inflate: codes ok\n"));
|
||||||
@ -513,7 +513,7 @@ void FAR *out_desc;
|
|||||||
/* invalid code */
|
/* invalid code */
|
||||||
if (this.op & 64) {
|
if (this.op & 64) {
|
||||||
strm->msg = "invalid literal/length code";
|
strm->msg = "invalid literal/length code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -545,7 +545,7 @@ void FAR *out_desc;
|
|||||||
DROPBITS(this.bits);
|
DROPBITS(this.bits);
|
||||||
if (this.op & 64) {
|
if (this.op & 64) {
|
||||||
strm->msg = "invalid distance code";
|
strm->msg = "invalid distance code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->offset = (unsigned)this.val;
|
state->offset = (unsigned)this.val;
|
||||||
@ -560,7 +560,7 @@ void FAR *out_desc;
|
|||||||
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
if (state->offset > state->wsize - (state->whave < state->wsize ?
|
||||||
left : 0)) {
|
left : 0)) {
|
||||||
strm->msg = "invalid distance too far back";
|
strm->msg = "invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
||||||
@ -595,7 +595,7 @@ void FAR *out_desc;
|
|||||||
}
|
}
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
|
|
||||||
case BAD:
|
case BAD_DATA:
|
||||||
ret = Z_DATA_ERROR;
|
ret = Z_DATA_ERROR;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
LEN -- ran out of enough output space or enough available input
|
LEN -- ran out of enough output space or enough available input
|
||||||
TYPE -- reached end of block code, inflate() to interpret next block
|
TYPE -- reached end of block code, inflate() to interpret next block
|
||||||
BAD -- error in block data
|
BAD_DATA -- error in block data
|
||||||
|
|
||||||
Notes:
|
Notes:
|
||||||
|
|
||||||
@ -176,7 +176,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (dist > dmax) {
|
if (dist > dmax) {
|
||||||
strm->msg = (char *)"invalid distance too far back";
|
strm->msg = (char *)"invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -188,7 +188,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|||||||
op = dist - op; /* distance back in window */
|
op = dist - op; /* distance back in window */
|
||||||
if (op > whave) {
|
if (op > whave) {
|
||||||
strm->msg = "invalid distance too far back";
|
strm->msg = "invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
from = window - OFF;
|
from = window - OFF;
|
||||||
@ -264,7 +264,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strm->msg = "invalid distance code";
|
strm->msg = "invalid distance code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -279,7 +279,7 @@ unsigned start; /* inflate()'s starting value for strm->avail_out */
|
|||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
strm->msg = "invalid literal/length code";
|
strm->msg = "invalid literal/length code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (in < last && out < end);
|
} while (in < last && out < end);
|
||||||
|
@ -609,19 +609,19 @@ int flush;
|
|||||||
#endif
|
#endif
|
||||||
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
((BITS(8) << 8) + (hold >> 8)) % 31) {
|
||||||
strm->msg = "incorrect header check";
|
strm->msg = "incorrect header check";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (BITS(4) != Z_DEFLATED) {
|
if (BITS(4) != Z_DEFLATED) {
|
||||||
strm->msg = "unknown compression method";
|
strm->msg = "unknown compression method";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
DROPBITS(4);
|
DROPBITS(4);
|
||||||
len = BITS(4) + 8;
|
len = BITS(4) + 8;
|
||||||
if (len > state->wbits) {
|
if (len > state->wbits) {
|
||||||
strm->msg = "invalid window size";
|
strm->msg = "invalid window size";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->dmax = 1U << len;
|
state->dmax = 1U << len;
|
||||||
@ -636,12 +636,12 @@ int flush;
|
|||||||
state->flags = (int)(hold);
|
state->flags = (int)(hold);
|
||||||
if ((state->flags & 0xff) != Z_DEFLATED) {
|
if ((state->flags & 0xff) != Z_DEFLATED) {
|
||||||
strm->msg = "unknown compression method";
|
strm->msg = "unknown compression method";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (state->flags & 0xe000) {
|
if (state->flags & 0xe000) {
|
||||||
strm->msg = "unknown header flags set";
|
strm->msg = "unknown header flags set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (state->head != Z_NULL)
|
if (state->head != Z_NULL)
|
||||||
@ -745,7 +745,7 @@ int flush;
|
|||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
if (hold != (state->check & 0xffff)) {
|
if (hold != (state->check & 0xffff)) {
|
||||||
strm->msg = "header crc mismatch";
|
strm->msg = "header crc mismatch";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
INITBITS();
|
INITBITS();
|
||||||
@ -800,7 +800,7 @@ int flush;
|
|||||||
break;
|
break;
|
||||||
case 3:
|
case 3:
|
||||||
strm->msg = "invalid block type";
|
strm->msg = "invalid block type";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
}
|
}
|
||||||
DROPBITS(2);
|
DROPBITS(2);
|
||||||
break;
|
break;
|
||||||
@ -809,7 +809,7 @@ int flush;
|
|||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
if ((hold & 0xffff) != ((hold >> 16) ^ 0xffff)) {
|
||||||
strm->msg = "invalid stored block lengths";
|
strm->msg = "invalid stored block lengths";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->length = (unsigned)hold & 0xffff;
|
state->length = (unsigned)hold & 0xffff;
|
||||||
@ -845,7 +845,7 @@ int flush;
|
|||||||
#ifndef PKZIP_BUG_WORKAROUND
|
#ifndef PKZIP_BUG_WORKAROUND
|
||||||
if (state->nlen > 286 || state->ndist > 30) {
|
if (state->nlen > 286 || state->ndist > 30) {
|
||||||
strm->msg = "too many length or distance symbols";
|
strm->msg = "too many length or distance symbols";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
@ -867,7 +867,7 @@ int flush;
|
|||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid code lengths set";
|
strm->msg = "invalid code lengths set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracev((stderr, "inflate: code lengths ok\n"));
|
Tracev((stderr, "inflate: code lengths ok\n"));
|
||||||
@ -891,7 +891,7 @@ int flush;
|
|||||||
DROPBITS(this.bits);
|
DROPBITS(this.bits);
|
||||||
if (state->have == 0) {
|
if (state->have == 0) {
|
||||||
strm->msg = "invalid bit length repeat";
|
strm->msg = "invalid bit length repeat";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
len = state->lens[state->have - 1];
|
len = state->lens[state->have - 1];
|
||||||
@ -914,7 +914,7 @@ int flush;
|
|||||||
}
|
}
|
||||||
if (state->have + copy > state->nlen + state->ndist) {
|
if (state->have + copy > state->nlen + state->ndist) {
|
||||||
strm->msg = "invalid bit length repeat";
|
strm->msg = "invalid bit length repeat";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
while (copy--)
|
while (copy--)
|
||||||
@ -923,7 +923,7 @@ int flush;
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* handle error breaks in while */
|
/* handle error breaks in while */
|
||||||
if (state->mode == BAD) break;
|
if (state->mode == BAD_DATA) break;
|
||||||
|
|
||||||
/* build code tables */
|
/* build code tables */
|
||||||
state->next = state->codes;
|
state->next = state->codes;
|
||||||
@ -933,7 +933,7 @@ int flush;
|
|||||||
&(state->lenbits), state->work);
|
&(state->lenbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid literal/lengths set";
|
strm->msg = "invalid literal/lengths set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->distcode = (code const FAR *)(state->next);
|
state->distcode = (code const FAR *)(state->next);
|
||||||
@ -942,7 +942,7 @@ int flush;
|
|||||||
&(state->next), &(state->distbits), state->work);
|
&(state->next), &(state->distbits), state->work);
|
||||||
if (ret) {
|
if (ret) {
|
||||||
strm->msg = "invalid distances set";
|
strm->msg = "invalid distances set";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracev((stderr, "inflate: codes ok\n"));
|
Tracev((stderr, "inflate: codes ok\n"));
|
||||||
@ -985,7 +985,7 @@ int flush;
|
|||||||
}
|
}
|
||||||
if (this.op & 64) {
|
if (this.op & 64) {
|
||||||
strm->msg = "invalid literal/length code";
|
strm->msg = "invalid literal/length code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->extra = (unsigned)(this.op) & 15;
|
state->extra = (unsigned)(this.op) & 15;
|
||||||
@ -1017,7 +1017,7 @@ int flush;
|
|||||||
DROPBITS(this.bits);
|
DROPBITS(this.bits);
|
||||||
if (this.op & 64) {
|
if (this.op & 64) {
|
||||||
strm->msg = "invalid distance code";
|
strm->msg = "invalid distance code";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
state->offset = (unsigned)this.val;
|
state->offset = (unsigned)this.val;
|
||||||
@ -1032,13 +1032,13 @@ int flush;
|
|||||||
#ifdef INFLATE_STRICT
|
#ifdef INFLATE_STRICT
|
||||||
if (state->offset > state->dmax) {
|
if (state->offset > state->dmax) {
|
||||||
strm->msg = "invalid distance too far back";
|
strm->msg = "invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if (state->offset > state->whave + out - left) {
|
if (state->offset > state->whave + out - left) {
|
||||||
strm->msg = "invalid distance too far back";
|
strm->msg = "invalid distance too far back";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
Tracevv((stderr, "inflate: distance %u\n", state->offset));
|
||||||
@ -1090,7 +1090,7 @@ int flush;
|
|||||||
#endif
|
#endif
|
||||||
REVERSE(hold)) != state->check) {
|
REVERSE(hold)) != state->check) {
|
||||||
strm->msg = "incorrect data check";
|
strm->msg = "incorrect data check";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
INITBITS();
|
INITBITS();
|
||||||
@ -1103,7 +1103,7 @@ int flush;
|
|||||||
NEEDBITS(32);
|
NEEDBITS(32);
|
||||||
if (hold != (state->total & 0xffffffffUL)) {
|
if (hold != (state->total & 0xffffffffUL)) {
|
||||||
strm->msg = "incorrect length check";
|
strm->msg = "incorrect length check";
|
||||||
state->mode = BAD;
|
state->mode = BAD_DATA;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
INITBITS();
|
INITBITS();
|
||||||
@ -1114,7 +1114,7 @@ int flush;
|
|||||||
case DONE:
|
case DONE:
|
||||||
ret = Z_STREAM_END;
|
ret = Z_STREAM_END;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
case BAD:
|
case BAD_DATA:
|
||||||
ret = Z_DATA_ERROR;
|
ret = Z_DATA_ERROR;
|
||||||
goto inf_leave;
|
goto inf_leave;
|
||||||
case MEM:
|
case MEM:
|
||||||
|
@ -45,7 +45,7 @@ typedef enum {
|
|||||||
CHECK, /* i: waiting for 32-bit check value */
|
CHECK, /* i: waiting for 32-bit check value */
|
||||||
LENGTH, /* i: waiting for 32-bit length (gzip) */
|
LENGTH, /* i: waiting for 32-bit length (gzip) */
|
||||||
DONE, /* finished check, done -- remain here until reset */
|
DONE, /* finished check, done -- remain here until reset */
|
||||||
BAD, /* got a data error -- remain here until reset */
|
BAD_DATA, /* got a data error -- remain here until reset */
|
||||||
MEM, /* got an inflate() memory error -- remain here until reset */
|
MEM, /* got an inflate() memory error -- remain here until reset */
|
||||||
SYNC /* looking for synchronization bytes to restart inflate() */
|
SYNC /* looking for synchronization bytes to restart inflate() */
|
||||||
} inflate_mode;
|
} inflate_mode;
|
||||||
@ -53,7 +53,7 @@ typedef enum {
|
|||||||
/*
|
/*
|
||||||
State transitions between above modes -
|
State transitions between above modes -
|
||||||
|
|
||||||
(most modes can go to the BAD or MEM mode -- not shown for clarity)
|
(most modes can go to the BAD_DATA or MEM mode -- not shown for clarity)
|
||||||
|
|
||||||
Process header:
|
Process header:
|
||||||
HEAD -> (gzip) or (zlib)
|
HEAD -> (gzip) or (zlib)
|
||||||
|
Loading…
Reference in New Issue
Block a user