static int
asnAddNet(char *as_string, int as_number)
{
- rtentry_t *e;
-
struct squid_radix_node *rn;
CbDataList<int> **Tail = NULL;
CbDataList<int> *q = NULL;
debugs(53, 3, "asnAddNet: called for " << addr << "/" << mask );
- e = (rtentry_t *)xmalloc(sizeof(rtentry_t));
-
- memset(e, '\0', sizeof(rtentry_t));
+ rtentry_t *e = (rtentry_t *)xcalloc(1, sizeof(rtentry_t));
e->e_addr.addr = addr;
char bufa[256], bufb[256];
t = strtokFile();
- if (!t)
+ if (!t) {
+ debugs(28, DBG_PARSE_NOTE(DBG_IMPORTANT), "ACL random missing pattern");
return;
+ }
debugs(28, 5, "aclParseRandomData: " << t);
if (sscanf(t, "%[0-9]:%[0-9]", bufa, bufb) == 2) {
int a = xatoi(bufa);
int b = xatoi(bufb);
- if (a == 0 || b == 0) {
+ if (a <= 0 || b <= 0) {
debugs(28, DBG_CRITICAL, "ERROR: ACL random with bad pattern: '" << t << "'");
return;
} else
} else if (sscanf(t, "%[0-9]/%[0-9]", bufa, bufb) == 2) {
int a = xatoi(bufa);
int b = xatoi(bufb);
- if (a == 0 || b == 0) {
+ if (a <= 0 || b <= 0) {
debugs(28, DBG_CRITICAL, "ERROR: ACL random with bad pattern: '" << t << "'");
return;
} else