Skip to content

sizeof(of.size) is not necessarily the bytes taken by %z #3

Description

@duhoobo

Found several odd lines of code:

        216 str_buffer.data = ngx_palloc(r->pool,
        217     3 + r->uri.len + sizeof(of.size) + sizeof(of.mtime)  
        218     );

        225 str_buffer.len = ngx_sprintf(str_buffer.data, "%V_%T_%z",&r->uri,of.mtime,of.size) - str_buffer.data;

sizeof(of.size) and sizeof(of.mtime) will only return the bytes occupied by integer representation of these two fields. But the converted strings may need more.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions