mirror of
https://github.com/mtrojnar/osslsigncode.git
synced 2025-04-04 17:00:11 -05:00
Fixed out-of-bounds access, CID 1583604
This commit is contained in:
parent
ee3c51f6d5
commit
5ee859db2c
7
script.c
7
script.c
@ -635,16 +635,17 @@ static SCRIPT_CTX *script_ctx_get(char *indata, uint32_t filesize, const SCRIPT_
|
||||
const char *input_pos, *signature_pos, *ptr;
|
||||
uint32_t line[LINE_MAX_LEN], sig_start[40], cr, lf;
|
||||
size_t sig_pos = 0, line_pos = 0, sig_start_pos = 0;
|
||||
size_t sig_start_size = sizeof sig_start / sizeof(uint32_t);
|
||||
|
||||
utf8DecodeRune("\r", 1, &cr);
|
||||
utf8DecodeRune("\n", 1, &lf);
|
||||
|
||||
/* compute runes for the beginning of the signature */
|
||||
for (ptr = comment->open; *ptr; sig_start_pos++)
|
||||
for (ptr = comment->open; *ptr && sig_start_pos < sig_start_size; sig_start_pos++)
|
||||
ptr = utf8DecodeRune(ptr, 1, sig_start + sig_start_pos);
|
||||
for (ptr = signature_begin; *ptr; sig_start_pos++)
|
||||
for (ptr = signature_begin; *ptr && sig_start_pos < sig_start_size; sig_start_pos++)
|
||||
ptr = utf8DecodeRune(ptr, 1, sig_start + sig_start_pos);
|
||||
for (ptr = comment->close; *ptr; sig_start_pos++)
|
||||
for (ptr = comment->close; *ptr && sig_start_pos < sig_start_size; sig_start_pos++)
|
||||
ptr = utf8DecodeRune(ptr, 1, sig_start + sig_start_pos);
|
||||
|
||||
/* find the beginning of the signature */
|
||||
|
Loading…
x
Reference in New Issue
Block a user