134 |
int howmuch; |
int howmuch; |
135 |
|
|
136 |
if (!strncasecmp(buf, "Status: ", 8)) { |
if (!strncasecmp(buf, "Status: ", 8)) { |
137 |
char str_status[4]; |
char str_status[24]; |
138 |
char desc[32]; |
char desc[32]; |
139 |
int len; |
int len; |
140 |
char *p = buf+8; |
char *p = buf+8; |
142 |
len = 0; |
len = 0; |
143 |
while( *p != ' ' && *p != 0) { len++; p++; } |
while( *p != ' ' && *p != 0) { len++; p++; } |
144 |
|
|
145 |
if (len > 3) { /* status code too long! */ |
if (len > sizeof(str_status)-1) { /* status code too long! */ |
146 |
req->buffer_start = req->buffer_end = 0; |
req->buffer_start = req->buffer_end = 0; |
147 |
|
log_error_time(); |
148 |
|
fprintf(stderr, "status code (%d bytes) is too long\n", len); |
149 |
|
fprintf(stderr, "status code: '%s'\n", buf+8); |
150 |
send_r_error(req); |
send_r_error(req); |
151 |
return 0; |
return 0; |
152 |
} |
} |
159 |
|
|
160 |
if (len > sizeof(desc)-1) { /* description long! */ |
if (len > sizeof(desc)-1) { /* description long! */ |
161 |
req->buffer_start = req->buffer_end = 0; |
req->buffer_start = req->buffer_end = 0; |
162 |
|
log_error_time(); |
163 |
|
fprintf(stderr, "description (%d bytes) is too long\n", len); |
164 |
send_r_error(req); |
send_r_error(req); |
165 |
return 0; |
return 0; |
166 |
} |
} |