vBulletin Search Engine Optimization
| |||||||
| Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| On Wed, 29 Mar 2006, Daniel Ouellet wrote: some comments: > --- src/main/http_core.c 22 Feb 2006 15:07:12 -0000 1.21 > +++ src/main/http_core.c 29 Mar 2006 06:51:14 -0000 .... > - port = ap_strtol(ports, &endptr, 10); > - if (errno /* some sort of error */ > - || (endptr && *endptr) /* make sure no trailing characters */ > - || port < 1 || port > 65535) /* underflow/overflow */ > - { > + port = strtol(ports, &endptr, 10); > + if(ports[0] == '\0' || *endptr != '\0' || errno == ERANGE > + || port < 1 || port > 65535) { > return "Missing, invalid, or non-numeric port"; this is a perfect case for strtonum > - /* WTF: If strtoul is not portable, then write a replacement. > - * Instead we have an idiotic define in httpd.h that prevents > - * it from being used even when it is available. Sheesh. > - */ > - conf->limit_req_body = (unsigned long)ap_strtol(arg, (char **)NULL, 10); > + conf->limit_req_body = strtoul(arg, (char **)NULL, 10); > return NULL; here too? > --- src/main/http_protocol.c 11 Feb 2006 19:15:57 -0000 1.30 > +++ src/main/http_protocol.c 29 Mar 2006 06:51:15 -0000 .... > - if (errno || (endstr && *endstr) || (r->remaining < 0)) { > - conversion_error = 1; > + r->remaining = strtol(lenp, &endstr, 10); > + if (errno == ERANGE || lenp[0] == '\0' || *endstr != '\0' > + || (r->remaining < 0)) { > + conversion_error = 1; ditto |