Maxim Dounin
June 25, 2014 08:14PM
details: http://hg.nginx.org/nginx/rev/b490bfbf8cfa
branches:
changeset: 5741:b490bfbf8cfa
user: Maxim Dounin <mdounin@mdounin.ru>
date: Thu Jun 26 03:34:13 2014 +0400
description:
Fixed wrong sizeof() in ngx_http_init_locations().

There is no real difference on all known platforms, but it's still wrong.

Found by Coverity (CID 400876).

diffstat:

src/http/ngx_http.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff --git a/src/http/ngx_http.c b/src/http/ngx_http.c
--- a/src/http/ngx_http.c
+++ b/src/http/ngx_http.c
@@ -742,7 +742,7 @@ ngx_http_init_locations(ngx_conf_t *cf,

if (named) {
clcfp = ngx_palloc(cf->pool,
- (n + 1) * sizeof(ngx_http_core_loc_conf_t **));
+ (n + 1) * sizeof(ngx_http_core_loc_conf_t *));
if (clcfp == NULL) {
return NGX_ERROR;
}
@@ -768,7 +768,7 @@ ngx_http_init_locations(ngx_conf_t *cf,
if (regex) {

clcfp = ngx_palloc(cf->pool,
- (r + 1) * sizeof(ngx_http_core_loc_conf_t **));
+ (r + 1) * sizeof(ngx_http_core_loc_conf_t *));
if (clcfp == NULL) {
return NGX_ERROR;
}

_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[nginx] Fixed wrong sizeof() in ngx_http_init_locations().

Maxim Dounin 464 June 25, 2014 08:14PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 303
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready