mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-01 13:10:43 +00:00
Fix #2612 - struct mg_str::ptr -> buf
This commit is contained in:
1 parent
e93d18d200
commit
e0e599ffa1
61 files changed
+684
-686
No files matched your search
+3
-3
@@ -98,9 +98,9 @@ int mg_check_ip_acl(struct mg_str acl, struct mg_addr *remote_ip) {
|
||||
memcpy((void *) &remote_ip4, remote_ip->ip, sizeof(remote_ip4));
|
||||
while (mg_span(acl, &entry, &acl, ',')) {
|
||||
uint32_t net, mask;
|
||||
if (entry.ptr[0] != '+' && entry.ptr[0] != '-') return -1;
|
||||
if (parse_net(&entry.ptr[1], &net, &mask) == 0) return -2;
|
||||
if ((mg_ntohl(remote_ip4) & mask) == net) allowed = entry.ptr[0];
|
||||
if (entry.buf[0] != '+' && entry.buf[0] != '-') return -1;
|
||||
if (parse_net(&entry.buf[1], &net, &mask) == 0) return -2;
|
||||
if ((mg_ntohl(remote_ip4) & mask) == net) allowed = entry.buf[0];
|
||||
}
|
||||
}
|
||||
return allowed == '+';
|
||||
|
||||
Reference in new issue
Block a user