ben 96/08/25 10:32:35
Modified: src http_core.c Log: Make it an error to have a non-numeric port number in a Listen directive. Revision Changes Path 1.33 +5 -1 apache/src/http_core.c Index: http_core.c =================================================================== RCS file: /export/home/cvs/apache/src/http_core.c,v retrieving revision 1.32 retrieving revision 1.33 diff -C3 -r1.32 -r1.33 *** http_core.c 1996/08/20 11:50:44 1.32 --- http_core.c 1996/08/25 17:32:33 1.33 *************** *** 981,986 **** --- 981,987 ---- { listen_rec *new; char *ports; + int port; if (cmd->server->is_virtual) return "Listen not allowed in <VirtualHost>"; ports=strchr(ips, ':'); *************** *** 999,1005 **** new->local_addr.sin_addr.s_addr = htonl(INADDR_ANY); else new->local_addr.sin_addr.s_addr = get_virthost_addr(ips, NULL); ! new->local_addr.sin_port = htons(atoi(ports)); new->fd = -1; new->next = listeners; listeners = new; --- 1000,1009 ---- new->local_addr.sin_addr.s_addr = htonl(INADDR_ANY); else new->local_addr.sin_addr.s_addr = get_virthost_addr(ips, NULL); ! port=atoi(ports); ! if(!port) ! return "Port must be numeric"; ! new->local_addr.sin_port = htons(port); new->fd = -1; new->next = listeners; listeners = new;