aboutsummaryrefslogtreecommitdiff
path: root/src/stream/ngx_stream_geo_module.c
Commit message (Collapse)AuthorAge
* Fixed undefined behaviour with IPv4-mapped IPv6 addresses.Sergey Kandaurov2024-03-18
| | | | | | | | | | | | | | | | Previously, it could result when left-shifting signed integer due to implicit integer promotion, such that the most significant bit appeared on the sign bit. In practice, though, this results in the same left value as with an explicit cast, at least on known compilers, such as GCC and Clang. The reason is that in_addr_t, which is equivalent to uint32_t and same as "unsigned int" in ILP32 and LP64 data type models, has the same type width as the intermediate after integer promotion, so there's no side effects such as sign-extension. This explains why adding an explicit cast does not change object files in practice. Found with UndefinedBehaviorSanitizer (shift). Based on a patch by Piotr Sikora.
* Geo: fixed uninitialized memory access.Piotr Sikora2024-03-14
| | | | | | | | | | | | While copying ngx_http_variable_value_t structures to geo binary base in ngx_http_geo_copy_values(), and similarly in the stream module, uninitialized parts of these structures are copied as well. These include the "escape" field and possible holes. Calculating crc32 of this data triggers uninitialized memory access. Found with MemorySanitizer. Signed-off-by: Piotr Sikora <piotr@aviatrix.com>
* Geo: fixed handling of AF_UNIX client addresses (ticket #1684).Maxim Dounin2018-12-14
| | | | | Previously, AF_UNIX client addresses were handled as AF_INET, leading to unexpected results.
* Geo: fixed indentation.Sergey Kandaurov2018-02-21
|
* Geo: optimized configuration parser.Ruslan Ermilov2018-02-21
| | | | If the geo block parser has failed, doing more things is pointless.
* Geo: fixed memory allocation error handling (closes #1482).Ruslan Ermilov2018-02-21
| | | | | | If during configuration parsing of the geo directive the memory allocation has failed, pool used to parse configuration inside the block, and sometimes the temporary pool were not destroyed.
* Fixed calls to ngx_open_file() in certain places.Sergey Kandaurov2017-08-09
| | | | | | Pass NGX_FILE_OPEN to ngx_open_file() to fix "The parameter is incorrect" error on win32 when using the ssl_session_ticket_key directive or loading a binary geo base. On UNIX, this change is a no-op.
* Style.Sergey Kandaurov2017-08-09
|
* Geo: fixed warnings when removing nonexistent ranges.Ruslan Ermilov2016-08-23
| | | | | | | | | | | | | geo $geo { ranges; 10.0.0.0-10.0.0.255 test; delete 10.0.1.0-10.0.1.255; # should warn delete 10.0.0.0-10.0.0.255; delete 10.0.0.0-10.0.0.255; # should warn }
* Geo: fixed insertion of ranges specified in descending order.Ruslan Ermilov2016-08-23
|
* Geo: fixed removing a range in certain cases.Ruslan Ermilov2016-08-23
| | | | | | If the range includes two or more /16 networks and does not start at the /16 boundary, the last subrange was not removed (see 91cff7f97a50 for details).
* Geo: fixed overflow when iterating over ranges.Ruslan Ermilov2016-08-23
|
* Geo: fixed access to already freed memory.Valentin Bartenev2016-08-18
| | | | | Previously, in "ranges" mode when all added ranges were deleted, the ctx.high.low[i] was left pointing to a temporary array.
* Stream: geo module.Vladimir Homutov2016-06-30