]> git.kaiwu.me - njs.git/commit
Fixed one byte overread in njs_string_to_c_string().
authorValentin Bartenev <vbart@nginx.com>
Thu, 25 Jul 2019 17:17:42 +0000 (20:17 +0300)
committerValentin Bartenev <vbart@nginx.com>
Thu, 25 Jul 2019 17:17:42 +0000 (20:17 +0300)
commit43700ddc5848efaaee49c77b4cd6e2e27774755d
tree74ad71ea1c3bb1196a3cbaf6ea7fe1f5744c28e9
parentb63faf66a0a7d471127d9a57e6a7cb21271517ca
Fixed one byte overread in njs_string_to_c_string().

Short strings are packed quite tight in njs_value_t, so there's
no one more byte to test.

    struct {
        njs_value_type_t              type:8;

        uint8_t                       size:4;
        uint8_t                       length:4;

        u_char                        start[14];
    } short_string;

With 14 bytes string this occupies 16 bytes, which is equal
to sizeof(njs_value_t).
njs/njs_string.c