comparison src/core/ngx_inet.c @ 3894:4d4b5770616f

fix segfault in IPv6 parsing while processing invalid IPv4 address X.YYYY.Z patch by Maxim Dounin
author Igor Sysoev <igor@sysoev.ru>
date Fri, 15 Apr 2011 13:50:27 +0000
parents 8e77b5216894
children 4af8ea9c3a86
comparison
equal deleted inserted replaced
3893:5581586480e9 3894:4d4b5770616f
108 108
109 return NGX_ERROR; 109 return NGX_ERROR;
110 } 110 }
111 111
112 if (c == '.' && nibbles) { 112 if (c == '.' && nibbles) {
113 if (n < 2) { 113 if (n < 2 || digit == NULL) {
114 return NGX_ERROR; 114 return NGX_ERROR;
115 } 115 }
116 116
117 word = ngx_inet_addr(digit, len4 - 1); 117 word = ngx_inet_addr(digit, len4 - 1);
118 if (word == INADDR_NONE) { 118 if (word == INADDR_NONE) {