Skip to content
Snippets Groups Projects
Commit 6ea69d6d authored by deuce's avatar deuce
Browse files

Fix crash when decompressing on FreeBSD.

This does not fix the underlying problem, just prevents twiddling outside
of the array bounds.
parent b5abaf57
Branches
Tags
No related merge requests found
...@@ -468,7 +468,7 @@ static void lzh_update(lzh_t* lzh, short int c) ...@@ -468,7 +468,7 @@ static void lzh_update(lzh_t* lzh, short int c)
c = l; c = l;
} }
} while ((c = lzh->prnt[c]) != 0); /* do it until reaching the root */ } while (((c = lzh->prnt[c]) != 0) && c < (sizeof(lzh->son)/sizeof(lzh->son[0]))); /* do it until reaching the root */
} }
static void lzh_encode_char(lzh_t* lzh, unsigned short c, uint8_t *outbuf, int32_t *outlen) static void lzh_encode_char(lzh_t* lzh, unsigned short c, uint8_t *outbuf, int32_t *outlen)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment