Skip to content

Commit 5b8376c

Browse files
mcb30mtrojnar
authored andcommitted
Fix construction of signed CAB header
Commit 0f51a06 ("Separate common and format-dependent functions") performed a substantial amount of refactoring. Within the CFFOLDER header construction loop in cab_add_header(), the line tmp = GET_UINT32_LE(indata + i); seems to have been accidentally deleted, instead of being refactored to become tmp = GET_UINT32_LE(ctx->options->indata + i); with the result that adding a signature to a .cab file will currently produce an invalid .cab file. Fix by adding back in the missing line of code. Signed-off-by: Michael Brown <mbrown@fensystems.co.uk>
1 parent 1fc2c93 commit 5b8376c

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

cab.c

+1
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,7 @@ static int cab_add_header(FILE_FORMAT_CTX *ctx, BIO *hash, BIO *outdata)
900900
*/
901901
nfolders = GET_UINT16_LE(ctx->options->indata + 26);
902902
while (nfolders) {
903+
tmp = GET_UINT32_LE(ctx->options->indata + i);
903904
tmp += 24;
904905
PUT_UINT32_LE(tmp, buf);
905906
BIO_write(hash, buf, 4);

0 commit comments

Comments
 (0)