← Commit list

d0143f8da

Denys Vlasenko
Denys Vlasenko
2026-09-21
SUCCESS Duration: 178s

Subject

httpd: remove one unnecessary check

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

networking/httpd.c+6 -3
@@ -653,14 +653,14 @@ static ALWAYS_INLINE void free_Htaccess_IP_list(Htaccess_IP **pptr)
#if ENABLE_FEATURE_HTTPD_ACL_IP
/* Returns presumed mask width in bits or < 0 on error.
* Updates strp, stores IP at provided pointer */
-static int scan_ip(const char **strp, uint32_t *ipp, unsigned char endc)
+static int scan_ip(const char **strp, uint32_t *ipp, char endc)
{
const char *p = *strp;
int auto_mask = 8;
uint32_t ip = 0;
int j;
- if (*p == '/')
+ if (*p == '/') /* Disallow "D:/24" (empty IP??) */
return -auto_mask;
for (j = 0; j < 4; j++) {
@@ -678,8 +678,11 @@ static int scan_ip(const char **strp, uint32_t *ipp, unsigned char endc)
}
if (*p == '.')
p++;
- if (*p != '/' && *p)
+ if (*p
+ // && *p != '/' -- no need to check, for "IP/MASK" scan_ip_mask() ignores auto_mask value, incorrect +=8 does not matter in this case
+ ) {
auto_mask += 8;
+ }
ip = (ip << 8) | octet;
}
if (*p) {