Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix vtsn.len type #269 #270

Merged
merged 1 commit into from
Apr 17, 2023
Merged

Fix vtsn.len type #269 #270

merged 1 commit into from
Apr 17, 2023

Conversation

u5surf
Copy link
Collaborator

@u5surf u5surf commented Apr 16, 2023

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

@u5surf u5surf requested a review from vozlt April 16, 2023 21:42
@u5surf u5surf merged commit bf64dbf into vozlt:master Apr 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

buffer size may be too small
2 participants