vozlt / nginx-module-vts

Nginx virtual host traffic status module
BSD 2-Clause "Simplified" License
3.17k stars 456 forks source link

Fix vtsn.len type #269 #270

Closed u5surf closed 1 year ago

u5surf commented 1 year ago

Fixes #269

The type of ngx_str_t.len is size_t. So it has occured the type mismatch between vtsn->len and key->len. https://github.com/nginx/nginx/blob/dfe70f74a3558f05142fb552cea239add123d414/src/core/ngx_string.h#L17 OTOH, ngx_read_file returns the value which type is ssize_t, it should realize casting safty between ssize_t and size_t in ngx_http_vhost_traffic_status_dump_restore. FYI: https://stackoverflow.com/questions/16086331/cast-ssize-t-or-size-t