src/http/ngx_http_upstream_round_robin.c:149: error: Buffer Overrun L3
  Offset: [0, 65535] Size: [6, +oo] by call to `ngx_inet_resolve_host`.

src/http/ngx_http_upstream_round_robin.c:149:9: Call
147.     u.port = (in_port_t) (us->port ? us->port : us->default_port);
148. 
149.     if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {
             ^
150.         if (u.err) {
151.             ngx_log_error(NGX_LOG_EMERG, cf->log, 0,

src/core/ngx_inet.c:688:1: Parameter `u->host.len`
  686. 
  687. 
  688. ngx_int_t
       ^
  689. ngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)
  690. {

src/core/ngx_inet.c:790:13: Call
  788.         u->addrs[0].socklen = sizeof(struct sockaddr_in);
  789. 
  790.         p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
                   ^
  791.         if (p == NULL) {
  792.             return NGX_ERROR;

src/core/ngx_palloc.c:155:13: Assignment
    153. 
    154.         do {
    155.             m = p->d.last;
                     ^
    156. 
    157.             if ((size_t) (p->d.end - m) >= size) {

src/core/ngx_palloc.c:160:17: Assignment
    158.                 p->d.last = m + size;
    159. 
    160.                 return m;
                         ^
    161.             }
    162. 

src/core/ngx_inet.c:790:9: Assignment
  788.         u->addrs[0].socklen = sizeof(struct sockaddr_in);
  789. 
  790.         p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);
               ^
  791.         if (p == NULL) {
  792.             return NGX_ERROR;

src/core/ngx_inet.c:795:32: Call
  793.         }
  794. 
  795.         u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",
                                      ^
  796.                                            &u->host, ntohs(port)) - p;
  797.         u->addrs[0].name.data = p;

src/core/ngx_string.c:95:1: Parameter `*buf`
    93. 
    94. 
    95. u_char * ngx_cdecl
        ^
    96. ngx_sprintf(u_char *buf, const char *fmt, ...)
    97. {

src/core/ngx_string.c:102:9: Call
    100. 
    101.     va_start(args, fmt);
    102.     p = ngx_vsnprintf(buf, /* STUB */ 65536, fmt, args);
                 ^
    103.     va_end(args);
    104. 

src/core/ngx_string.c:123:1: <Length trace>
121. 
122. 
123. u_char *
     ^
124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
125. {

src/core/ngx_string.c:123:1: Parameter `*buf`
      121. 
      122. 
      123. u_char *
           ^
      124. ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
      125. {

src/core/ngx_string.c:244:25: Array access: Offset: [0, 65535] Size: [6, +oo] by call to `ngx_inet_resolve_host` 
      242.                 if (slen == (size_t) -1) {
      243.                     while (*p && buf < last) {
      244.                         *buf++ = *p++;
                                   ^
      245.                     }
      246. 

u_char *
ngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)
{
    u_char                *p, zero, *last;
    int                    d;
    float                  f, scale;
    size_t                 len, slen;
    int64_t                i64;
    uint64_t               ui64;
    ngx_msec_t             ms;
    ngx_uint_t             width, sign, hex, max_width, frac_width, i;
    ngx_str_t             *v;
    ngx_variable_value_t  *vv;
    if (max == 0) {
        return buf;
    }
    last = buf + max;
    while (*fmt && buf < last) {
        if (*fmt == '%') {
            i64 = 0;
            ui64 = 0;
            zero = (u_char) ((*++fmt == '0') ? '0' : ' ');
            width = 0;
            sign = 1;
            hex = 0;
            max_width = 0;
            frac_width = 0;
            slen = (size_t) -1;
            while (*fmt >= '0' && *fmt <= '9') {
                width = width * 10 + *fmt++ - '0';
            }
            for ( ;; ) {
                switch (*fmt) {
                case 'u':
                    sign = 0;
                    fmt++;
                    continue;
                case 'm':
                    max_width = 1;
                    fmt++;
                    continue;
                case 'X':
                    hex = 2;
                    sign = 0;
                    fmt++;
                    continue;
                case 'x':
                    hex = 1;
                    sign = 0;
                    fmt++;
                    continue;
                case '.':
                    fmt++;
                    while (*fmt >= '0' && *fmt <= '9') {
                        frac_width = frac_width * 10 + *fmt++ - '0';
                    }
                    break;
                case '*':
                    slen = va_arg(args, size_t);
                    fmt++;
                    continue;
                default:
                    break;
                }
                break;
            }
            switch (*fmt) {
            case 'V':
                v = va_arg(args, ngx_str_t *);
                len = v->len;
                len = (buf + len < last) ? len : (size_t) (last - buf);
                buf = ngx_cpymem(buf, v->data, len);
                fmt++;
                continue;
            case 'v':
                vv = va_arg(args, ngx_variable_value_t *);
                len = vv->len;
                len = (buf + len < last) ? len : (size_t) (last - buf);
                buf = ngx_cpymem(buf, vv->data, len);
                fmt++;
                continue;
            case 's':
                p = va_arg(args, u_char *);
                if (slen == (size_t) -1) {
                    while (*p && buf < last) {
                        *buf++ = *p++;
                    }
                } else {
                    len = (buf + slen < last) ? slen : (size_t) (last - buf);
                    buf = ngx_cpymem(buf, p, len);
                }
                fmt++;
                continue;
            case 'O':
                i64 = (int64_t) va_arg(args, off_t);
                sign = 1;
                break;
            case 'P':
                i64 = (int64_t) va_arg(args, ngx_pid_t);
                sign = 1;
                break;
            case 'T':
                i64 = (int64_t) va_arg(args, time_t);
                sign = 1;
                break;
            case 'M':
                ms = (ngx_msec_t) va_arg(args, ngx_msec_t);
                if ((ngx_msec_int_t) ms == -1) {
                    sign = 1;
                    i64 = -1;
                } else {
                    sign = 0;
                    ui64 = (uint64_t) ms;
                }
                break;
            case 'z':
                if (sign) {
                    i64 = (int64_t) va_arg(args, ssize_t);
                } else {
                    ui64 = (uint64_t) va_arg(args, size_t);
                }
                break;
            case 'i':
                if (sign) {
                    i64 = (int64_t) va_arg(args, ngx_int_t);
                } else {
                    ui64 = (uint64_t) va_arg(args, ngx_uint_t);
                }
                if (max_width) {
                    width = NGX_INT_T_LEN;
                }
                break;
            case 'd':
                if (sign) {
                    i64 = (int64_t) va_arg(args, int);
                } else {
                    ui64 = (uint64_t) va_arg(args, u_int);
                }
                break;
            case 'l':
                if (sign) {
                    i64 = (int64_t) va_arg(args, long);
                } else {
                    ui64 = (uint64_t) va_arg(args, u_long);
                }
                break;
            case 'D':
                if (sign) {
                    i64 = (int64_t) va_arg(args, int32_t);
                } else {
                    ui64 = (uint64_t) va_arg(args, uint32_t);
                }
                break;
            case 'L':
                if (sign) {
                    i64 = va_arg(args, int64_t);
                } else {
                    ui64 = va_arg(args, uint64_t);
                }
                break;
            case 'A':
                if (sign) {
                    i64 = (int64_t) va_arg(args, ngx_atomic_int_t);
                } else {
                    ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t);
                }
                if (max_width) {
                    width = NGX_ATOMIC_T_LEN;
                }
                break;
            case 'f':
                f = (float) va_arg(args, double);
                if (f < 0) {
                    *buf++ = '-';
                    f = -f;
                }
                ui64 = (int64_t) f;
                buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);
                if (frac_width) {
                    if (buf < last) {
                        *buf++ = '.';
                    }
                    scale = 1.0;
                    for (i = 0; i < frac_width; i++) {
                        scale *= 10.0;
                    }
                    ui64 = (uint64_t) ((f - (int64_t) ui64) * scale);
                    buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width);
                }
                fmt++;
                continue;
#if !(NGX_WIN32)
            case 'r':
                i64 = (int64_t) va_arg(args, rlim_t);
                sign = 1;
                break;
#endif
            case 'p':
                ui64 = (uintptr_t) va_arg(args, void *);
                hex = 2;
                sign = 0;
                zero = '0';
                width = NGX_PTR_SIZE * 2;
                break;
            case 'c':
                d = va_arg(args, int);
                *buf++ = (u_char) (d & 0xff);
                fmt++;
                continue;
            case 'Z':
                *buf++ = '\0';
                fmt++;
                continue;
            case 'N':
#if (NGX_WIN32)
                *buf++ = CR;
#endif
                *buf++ = LF;
                fmt++;
                continue;
            case '%':
                *buf++ = '%';
                fmt++;
                continue;
            default:
                *buf++ = *fmt++;
                continue;
            }
            if (sign) {
                if (i64 < 0) {
                    *buf++ = '-';
                    ui64 = (uint64_t) -i64;
                } else {
                    ui64 = (uint64_t) i64;
                }
            }
            buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width);
            fmt++;
        } else {
            *buf++ = *fmt++;
        }
    }
    return buf;
}
['ngx_int_t\nngx_http_upstream_init_round_robin(ngx_conf_t *cf,\n    ngx_http_upstream_srv_conf_t *us)\n{\n    ngx_url_t                      u;\n    ngx_uint_t                     i, j, n;\n    ngx_http_upstream_server_t    *server;\n    ngx_http_upstream_rr_peers_t  *peers, *backup;\n    us->peer.init = ngx_http_upstream_init_round_robin_peer;\n    if (us->servers) {\n        server = us->servers->elts;\n        n = 0;\n        for (i = 0; i < us->servers->nelts; i++) {\n            if (server[i].backup) {\n                continue;\n            }\n            n += server[i].naddrs;\n        }\n        peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)\n                              + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));\n        if (peers == NULL) {\n            return NGX_ERROR;\n        }\n        peers->single = (n == 1);\n        peers->number = n;\n        peers->name = &us->host;\n        n = 0;\n        for (i = 0; i < us->servers->nelts; i++) {\n            for (j = 0; j < server[i].naddrs; j++) {\n                if (server[i].backup) {\n                    continue;\n                }\n                peers->peer[n].sockaddr = server[i].addrs[j].sockaddr;\n                peers->peer[n].socklen = server[i].addrs[j].socklen;\n                peers->peer[n].name = server[i].addrs[j].name;\n                peers->peer[n].max_fails = server[i].max_fails;\n                peers->peer[n].fail_timeout = server[i].fail_timeout;\n                peers->peer[n].down = server[i].down;\n                peers->peer[n].weight = server[i].down ? 0 : server[i].weight;\n                peers->peer[n].current_weight = peers->peer[n].weight;\n                n++;\n            }\n        }\n        us->peer.data = peers;\n        ngx_sort(&peers->peer[0], (size_t) n,\n                 sizeof(ngx_http_upstream_rr_peer_t),\n                 ngx_http_upstream_cmp_servers);\n        n = 0;\n        for (i = 0; i < us->servers->nelts; i++) {\n            if (!server[i].backup) {\n                continue;\n            }\n            n += server[i].naddrs;\n        }\n        if (n == 0) {\n            return NGX_OK;\n        }\n        backup = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)\n                              + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));\n        if (backup == NULL) {\n            return NGX_ERROR;\n        }\n        peers->single = 0;\n        backup->single = 0;\n        backup->number = n;\n        backup->name = &us->host;\n        n = 0;\n        for (i = 0; i < us->servers->nelts; i++) {\n            for (j = 0; j < server[i].naddrs; j++) {\n                if (!server[i].backup) {\n                    continue;\n                }\n                backup->peer[n].sockaddr = server[i].addrs[j].sockaddr;\n                backup->peer[n].socklen = server[i].addrs[j].socklen;\n                backup->peer[n].name = server[i].addrs[j].name;\n                backup->peer[n].weight = server[i].weight;\n                backup->peer[n].current_weight = server[i].weight;\n                backup->peer[n].max_fails = server[i].max_fails;\n                backup->peer[n].fail_timeout = server[i].fail_timeout;\n                backup->peer[n].down = server[i].down;\n                n++;\n            }\n        }\n        peers->next = backup;\n        ngx_sort(&backup->peer[0], (size_t) n,\n                 sizeof(ngx_http_upstream_rr_peer_t),\n                 ngx_http_upstream_cmp_servers);\n        return NGX_OK;\n    }\n    if (us->port == 0 && us->default_port == 0) {\n        ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n                      "no port in upstream \\"%V\\" in %s:%ui",\n                      &us->host, us->file_name, us->line);\n        return NGX_ERROR;\n    }\n    ngx_memzero(&u, sizeof(ngx_url_t));\n    u.host = us->host;\n    u.port = (in_port_t) (us->port ? us->port : us->default_port);\n    if (ngx_inet_resolve_host(cf->pool, &u) != NGX_OK) {\n        if (u.err) {\n            ngx_log_error(NGX_LOG_EMERG, cf->log, 0,\n                          "%s in upstream \\"%V\\" in %s:%ui",\n                          u.err, &us->host, us->file_name, us->line);\n        }\n        return NGX_ERROR;\n    }\n    n = u.naddrs;\n    peers = ngx_pcalloc(cf->pool, sizeof(ngx_http_upstream_rr_peers_t)\n                              + sizeof(ngx_http_upstream_rr_peer_t) * (n - 1));\n    if (peers == NULL) {\n        return NGX_ERROR;\n    }\n    peers->single = (n == 1);\n    peers->number = n;\n    peers->name = &us->host;\n    for (i = 0; i < u.naddrs; i++) {\n        peers->peer[i].sockaddr = u.addrs[i].sockaddr;\n        peers->peer[i].socklen = u.addrs[i].socklen;\n        peers->peer[i].name = u.addrs[i].name;\n        peers->peer[i].weight = 1;\n        peers->peer[i].current_weight = 1;\n        peers->peer[i].max_fails = 1;\n        peers->peer[i].fail_timeout = 10;\n    }\n    us->peer.data = peers;\n    return NGX_OK;\n}', 'ngx_int_t\nngx_inet_resolve_host(ngx_pool_t *pool, ngx_url_t *u)\n{\n    u_char              *p, *host;\n    size_t               len;\n    in_port_t            port;\n    in_addr_t            in_addr;\n    ngx_uint_t           i;\n    struct hostent      *h;\n    struct sockaddr_in  *sin;\n    host = ngx_alloc(u->host.len + 1, pool->log);\n    if (host == NULL) {\n        return NGX_ERROR;\n    }\n    (void) ngx_cpystrn(host, u->host.data, u->host.len + 1);\n    port = htons(u->port);\n    in_addr = inet_addr((char *) host);\n    if (in_addr == INADDR_NONE) {\n        h = gethostbyname((char *) host);\n        ngx_free(host);\n        if (h == NULL || h->h_addr_list[0] == NULL) {\n            u->err = "host not found";\n            return NGX_ERROR;\n        }\n        if (u->one_addr == 0) {\n            for (i = 0; h->h_addr_list[i] != NULL; i++) {   }\n        } else {\n            i = 1;\n        }\n        u->addrs = ngx_pcalloc(pool, i * sizeof(ngx_peer_addr_t));\n        if (u->addrs == NULL) {\n            return NGX_ERROR;\n        }\n        u->naddrs = i;\n        for (i = 0; h->h_addr_list[i] != NULL; i++) {\n            sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in));\n            if (sin == NULL) {\n                return NGX_ERROR;\n            }\n            sin->sin_family = AF_INET;\n            sin->sin_port = port;\n            sin->sin_addr.s_addr = *(in_addr_t *) (h->h_addr_list[i]);\n            u->addrs[i].sockaddr = (struct sockaddr *) sin;\n            u->addrs[i].socklen = sizeof(struct sockaddr_in);\n            len = NGX_INET_ADDRSTRLEN + sizeof(":65535") - 1;\n            p = ngx_pnalloc(pool, len);\n            if (p == NULL) {\n                return NGX_ERROR;\n            }\n            len = ngx_sock_ntop((struct sockaddr *) sin, p, len, 1);\n            u->addrs[i].name.len = len;\n            u->addrs[i].name.data = p;\n        }\n    } else {\n        ngx_free(host);\n        u->addrs = ngx_pcalloc(pool, sizeof(ngx_peer_addr_t));\n        if (u->addrs == NULL) {\n            return NGX_ERROR;\n        }\n        sin = ngx_pcalloc(pool, sizeof(struct sockaddr_in));\n        if (sin == NULL) {\n            return NGX_ERROR;\n        }\n        u->naddrs = 1;\n        sin->sin_family = AF_INET;\n        sin->sin_port = port;\n        sin->sin_addr.s_addr = in_addr;\n        u->addrs[0].sockaddr = (struct sockaddr *) sin;\n        u->addrs[0].socklen = sizeof(struct sockaddr_in);\n        p = ngx_pnalloc(pool, u->host.len + sizeof(":65535") - 1);\n        if (p == NULL) {\n            return NGX_ERROR;\n        }\n        u->addrs[0].name.len = ngx_sprintf(p, "%V:%d",\n                                           &u->host, ntohs(port)) - p;\n        u->addrs[0].name.data = p;\n    }\n    return NGX_OK;\n}', 'void *\nngx_pnalloc(ngx_pool_t *pool, size_t size)\n{\n    u_char      *m;\n    ngx_pool_t  *p;\n    if (size <= pool->max) {\n        p = pool->current;\n        do {\n            m = p->d.last;\n            if ((size_t) (p->d.end - m) >= size) {\n                p->d.last = m + size;\n                return m;\n            }\n            p = p->d.next;\n        } while (p);\n        return ngx_palloc_block(pool, size);\n    }\n    return ngx_palloc_large(pool, size);\n}', 'u_char * ngx_cdecl\nngx_sprintf(u_char *buf, const char *fmt, ...)\n{\n    u_char   *p;\n    va_list   args;\n    va_start(args, fmt);\n    p = ngx_vsnprintf(buf,   65536, fmt, args);\n    va_end(args);\n    return p;\n}', "u_char *\nngx_vsnprintf(u_char *buf, size_t max, const char *fmt, va_list args)\n{\n    u_char                *p, zero, *last;\n    int                    d;\n    float                  f, scale;\n    size_t                 len, slen;\n    int64_t                i64;\n    uint64_t               ui64;\n    ngx_msec_t             ms;\n    ngx_uint_t             width, sign, hex, max_width, frac_width, i;\n    ngx_str_t             *v;\n    ngx_variable_value_t  *vv;\n    if (max == 0) {\n        return buf;\n    }\n    last = buf + max;\n    while (*fmt && buf < last) {\n        if (*fmt == '%') {\n            i64 = 0;\n            ui64 = 0;\n            zero = (u_char) ((*++fmt == '0') ? '0' : ' ');\n            width = 0;\n            sign = 1;\n            hex = 0;\n            max_width = 0;\n            frac_width = 0;\n            slen = (size_t) -1;\n            while (*fmt >= '0' && *fmt <= '9') {\n                width = width * 10 + *fmt++ - '0';\n            }\n            for ( ;; ) {\n                switch (*fmt) {\n                case 'u':\n                    sign = 0;\n                    fmt++;\n                    continue;\n                case 'm':\n                    max_width = 1;\n                    fmt++;\n                    continue;\n                case 'X':\n                    hex = 2;\n                    sign = 0;\n                    fmt++;\n                    continue;\n                case 'x':\n                    hex = 1;\n                    sign = 0;\n                    fmt++;\n                    continue;\n                case '.':\n                    fmt++;\n                    while (*fmt >= '0' && *fmt <= '9') {\n                        frac_width = frac_width * 10 + *fmt++ - '0';\n                    }\n                    break;\n                case '*':\n                    slen = va_arg(args, size_t);\n                    fmt++;\n                    continue;\n                default:\n                    break;\n                }\n                break;\n            }\n            switch (*fmt) {\n            case 'V':\n                v = va_arg(args, ngx_str_t *);\n                len = v->len;\n                len = (buf + len < last) ? len : (size_t) (last - buf);\n                buf = ngx_cpymem(buf, v->data, len);\n                fmt++;\n                continue;\n            case 'v':\n                vv = va_arg(args, ngx_variable_value_t *);\n                len = vv->len;\n                len = (buf + len < last) ? len : (size_t) (last - buf);\n                buf = ngx_cpymem(buf, vv->data, len);\n                fmt++;\n                continue;\n            case 's':\n                p = va_arg(args, u_char *);\n                if (slen == (size_t) -1) {\n                    while (*p && buf < last) {\n                        *buf++ = *p++;\n                    }\n                } else {\n                    len = (buf + slen < last) ? slen : (size_t) (last - buf);\n                    buf = ngx_cpymem(buf, p, len);\n                }\n                fmt++;\n                continue;\n            case 'O':\n                i64 = (int64_t) va_arg(args, off_t);\n                sign = 1;\n                break;\n            case 'P':\n                i64 = (int64_t) va_arg(args, ngx_pid_t);\n                sign = 1;\n                break;\n            case 'T':\n                i64 = (int64_t) va_arg(args, time_t);\n                sign = 1;\n                break;\n            case 'M':\n                ms = (ngx_msec_t) va_arg(args, ngx_msec_t);\n                if ((ngx_msec_int_t) ms == -1) {\n                    sign = 1;\n                    i64 = -1;\n                } else {\n                    sign = 0;\n                    ui64 = (uint64_t) ms;\n                }\n                break;\n            case 'z':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, ssize_t);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, size_t);\n                }\n                break;\n            case 'i':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, ngx_int_t);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, ngx_uint_t);\n                }\n                if (max_width) {\n                    width = NGX_INT_T_LEN;\n                }\n                break;\n            case 'd':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, int);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, u_int);\n                }\n                break;\n            case 'l':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, long);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, u_long);\n                }\n                break;\n            case 'D':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, int32_t);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, uint32_t);\n                }\n                break;\n            case 'L':\n                if (sign) {\n                    i64 = va_arg(args, int64_t);\n                } else {\n                    ui64 = va_arg(args, uint64_t);\n                }\n                break;\n            case 'A':\n                if (sign) {\n                    i64 = (int64_t) va_arg(args, ngx_atomic_int_t);\n                } else {\n                    ui64 = (uint64_t) va_arg(args, ngx_atomic_uint_t);\n                }\n                if (max_width) {\n                    width = NGX_ATOMIC_T_LEN;\n                }\n                break;\n            case 'f':\n                f = (float) va_arg(args, double);\n                if (f < 0) {\n                    *buf++ = '-';\n                    f = -f;\n                }\n                ui64 = (int64_t) f;\n                buf = ngx_sprintf_num(buf, last, ui64, zero, 0, width);\n                if (frac_width) {\n                    if (buf < last) {\n                        *buf++ = '.';\n                    }\n                    scale = 1.0;\n                    for (i = 0; i < frac_width; i++) {\n                        scale *= 10.0;\n                    }\n                    ui64 = (uint64_t) ((f - (int64_t) ui64) * scale);\n                    buf = ngx_sprintf_num(buf, last, ui64, '0', 0, frac_width);\n                }\n                fmt++;\n                continue;\n#if !(NGX_WIN32)\n            case 'r':\n                i64 = (int64_t) va_arg(args, rlim_t);\n                sign = 1;\n                break;\n#endif\n            case 'p':\n                ui64 = (uintptr_t) va_arg(args, void *);\n                hex = 2;\n                sign = 0;\n                zero = '0';\n                width = NGX_PTR_SIZE * 2;\n                break;\n            case 'c':\n                d = va_arg(args, int);\n                *buf++ = (u_char) (d & 0xff);\n                fmt++;\n                continue;\n            case 'Z':\n                *buf++ = '\\0';\n                fmt++;\n                continue;\n            case 'N':\n#if (NGX_WIN32)\n                *buf++ = CR;\n#endif\n                *buf++ = LF;\n                fmt++;\n                continue;\n            case '%':\n                *buf++ = '%';\n                fmt++;\n                continue;\n            default:\n                *buf++ = *fmt++;\n                continue;\n            }\n            if (sign) {\n                if (i64 < 0) {\n                    *buf++ = '-';\n                    ui64 = (uint64_t) -i64;\n                } else {\n                    ui64 = (uint64_t) i64;\n                }\n            }\n            buf = ngx_sprintf_num(buf, last, ui64, zero, hex, width);\n            fmt++;\n        } else {\n            *buf++ = *fmt++;\n        }\n    }\n    return buf;\n}"]