mirror of
https://github.com/curl/curl.git
synced 2026-08-25 00:13:34 +03:00
Avoid typecasting a signed char to an int when using is*() functions, as that
could very well cause a negate number get passed in and thus cause reading outside of the array usually used for this purpose. We avoid this by using the uppercase macro versions introduced just now that does some extra crazy typecasts to avoid byte codes > 127 to cause negative int values.
This commit is contained in:
parent
930f9bd534
commit
44d84ac164
17 changed files with 81 additions and 59 deletions
|
|
@ -115,7 +115,7 @@ CHUNKcode Curl_httpchunk_read(struct connectdata *conn,
|
|||
while(length) {
|
||||
switch(ch->state) {
|
||||
case CHUNK_HEX:
|
||||
if(isxdigit((int)*datap)) {
|
||||
if(ISXDIGIT(*datap)) {
|
||||
if(ch->hexindex < MAXNUM_SIZE) {
|
||||
ch->hexbuffer[ch->hexindex] = *datap;
|
||||
datap++;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue