comparison src/stream/ngx_stream_geo_module.c @ 6661:ec141a44641b

Geo: fixed overflow when iterating over ranges.
author Ruslan Ermilov <ru@nginx.com>
date Tue, 23 Aug 2016 15:57:29 +0300
parents 873d7053efb9
children 1301a58b5dac
comparison
equal deleted inserted replaced
6660:3eb1a92a2f05 6661:ec141a44641b
894 range->end = (u_short) e; 894 range->end = (u_short) e;
895 range->value = ctx->value; 895 range->value = ctx->value;
896 896
897 next: 897 next:
898 898
899 continue; 899 if (h == 0xffff) {
900 break;
901 }
900 } 902 }
901 903
902 return NGX_CONF_OK; 904 return NGX_CONF_OK;
903 } 905 }
904 906
933 935
934 a = (ngx_array_t *) ctx->high.low[h]; 936 a = (ngx_array_t *) ctx->high.low[h];
935 937
936 if (a == NULL) { 938 if (a == NULL) {
937 warn = 1; 939 warn = 1;
938 continue; 940 goto next;
939 } 941 }
940 942
941 range = a->elts; 943 range = a->elts;
942 for (i = 0; i < a->nelts; i++) { 944 for (i = 0; i < a->nelts; i++) {
943 945
957 { 959 {
958 continue; 960 continue;
959 } 961 }
960 962
961 warn = 1; 963 warn = 1;
964 }
965
966 next:
967
968 if (h == 0xffff) {
969 break;
962 } 970 }
963 } 971 }
964 972
965 return warn; 973 return warn;
966 } 974 }