Mercurial > hg > nginx
comparison src/http/modules/ngx_http_headers_filter_module.c @ 6062:173561dfd567
Fixed invalid access to complex value defined as an empty string.
Found by Valgrind.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Tue, 31 Mar 2015 17:45:50 +0300 |
parents | 4983f7d18fe3 |
children | 8b6fa4842133 |
comparison
equal
deleted
inserted
replaced
6061:953ef81705e1 | 6062:173561dfd567 |
---|---|
376 *expires = NGX_HTTP_EXPIRES_OFF; | 376 *expires = NGX_HTTP_EXPIRES_OFF; |
377 return NGX_OK; | 377 return NGX_OK; |
378 } | 378 } |
379 } | 379 } |
380 | 380 |
381 if (value->data[0] == '@') { | 381 if (value->len && value->data[0] == '@') { |
382 value->data++; | 382 value->data++; |
383 value->len--; | 383 value->len--; |
384 minus = 0; | 384 minus = 0; |
385 | 385 |
386 if (*expires == NGX_HTTP_EXPIRES_MODIFIED) { | 386 if (*expires == NGX_HTTP_EXPIRES_MODIFIED) { |
388 return NGX_ERROR; | 388 return NGX_ERROR; |
389 } | 389 } |
390 | 390 |
391 *expires = NGX_HTTP_EXPIRES_DAILY; | 391 *expires = NGX_HTTP_EXPIRES_DAILY; |
392 | 392 |
393 } else if (value->data[0] == '+') { | 393 } else if (value->len && value->data[0] == '+') { |
394 value->data++; | 394 value->data++; |
395 value->len--; | 395 value->len--; |
396 minus = 0; | 396 minus = 0; |
397 | 397 |
398 } else if (value->data[0] == '-') { | 398 } else if (value->len && value->data[0] == '-') { |
399 value->data++; | 399 value->data++; |
400 value->len--; | 400 value->len--; |
401 minus = 1; | 401 minus = 1; |
402 | 402 |
403 } else { | 403 } else { |