September 25, 2016 12:12PM
details: http://hg.nginx.org/njs/rev/5ef1091ecfaf
branches:
changeset: 181:5ef1091ecfaf
user: Igor Sysoev <igor@sysoev.ru>
date: Sun Sep 25 10:54:51 2016 +0300
description:
A fix of possible sign extension overflow,
the issue has been found by Coverity Scan.

diffstat:

nxt/nxt_array.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diffs (21 lines):

diff -r 6a983847db14 -r 5ef1091ecfaf nxt/nxt_array.c
--- a/nxt/nxt_array.c Sat Sep 24 22:13:31 2016 +0300
+++ b/nxt/nxt_array.c Sun Sep 25 10:54:51 2016 +0300
@@ -113,7 +113,7 @@ nxt_array_add_multiple(nxt_array_t *arra
old = array->start;
array->start = start;

- memcpy(start, old, array->items * array->item_size);
+ memcpy(start, old, (uint32_t) array->items * array->item_size);

if (array->separate == 0) {
array->separate = 1;
@@ -123,7 +123,7 @@ nxt_array_add_multiple(nxt_array_t *arra
}
}

- item = (char *) array->start + array->items * array->item_size;
+ item = (char *) array->start + (uint32_t) array->items * array->item_size;

array->items = items;


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

[njs] A fix of possible sign extension overflow,

Igor Sysoev 949 September 25, 2016 12:12PM



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

Online Users

Guests: 137
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