Skip to content

Commit

Permalink
Add another memset() to test the memory sanitizer.
Browse files Browse the repository at this point in the history
TODO: remove after test

TODO: remove after test
  • Loading branch information
dillof committed Sep 29, 2023
1 parent 82e3054 commit f0abc64
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/zip_source_winzip_aes_encode.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,9 @@ encrypt_header(zip_source_t *src, struct winzip_aes *ctx) {
return -1;
}

/* TODO: The memset() is just for testing the memory sanitizer,
_zip_winzip_aes_new() will overwrite the same bytes */
memset(ctx->data + salt_length, 0xff, WINZIP_AES_PASSWORD_VERIFY_LENGTH);
if ((ctx->aes_ctx = _zip_winzip_aes_new((zip_uint8_t *)ctx->password, strlen(ctx->password), ctx->data, ctx->encryption_method, ctx->data + salt_length, &ctx->error)) == NULL) {
return -1;
}
Expand Down

0 comments on commit f0abc64

Please sign in to comment.