Skip to content

Commit 9b33b2e

Browse files
committed
Change conditions' order; cast isdigit()'s argument
1 parent f9248f9 commit 9b33b2e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/request_body_processor/multipart.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ int Multipart::parse_content_disposition(const char *c_d_value, int offset) {
362362
const char* start_of_filename = p;
363363
while ((*p != '\0') && (*p != ';')) {
364364
if (*p == '%') {
365-
if ((*(p+1) == '\0') || (!isxdigit(*(p+1))) || (*(p+2) == '\0') || (!isxdigit(static_cast<unsigned char>(*(p+2))))) {
365+
if ((*(p+1) == '\0') || (*(p+2) == '\0') || (!isxdigit(static_cast<unsigned char>(*(p+1)))) || (!isxdigit(static_cast<unsigned char>(*(p+2))))) {
366366
return -18;
367367
}
368368
p += 3;

0 commit comments

Comments
 (0)