-b <hostname>:<port_number>
-b <port_number>
-b <unix_socket_path>
}
#endif
+static int is_port_number(const char *bindpath)
+{
+ while (*bindpath) {
+ if (*bindpath < '0' || *bindpath > '9') {
+ return 0;
+ }
+ bindpath++;
+ }
+ return 1;
+}
+
/* {{{ main
*/
int main(int argc, char *argv[])
* path (it's what the fastcgi library expects)
*/
- if (strchr(bindpath, ':') == NULL) {
+ if (strchr(bindpath, ':') == NULL && is_port_number(bindpath)) {
char *tmp;
tmp = malloc(strlen(bindpath) + 2);