strongswan.org
Wiki/Project Management
Downloads
Gitweb
projects
/
strongswan.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
d7dc4fe
)
array: Number of items in get_size() is unsigned
author
Tobias Brunner
<tobias@strongswan.org>
Wed, 24 Jul 2013 14:03:38 +0000
(16:03 +0200)
committer
Tobias Brunner
<tobias@strongswan.org>
Thu, 25 Jul 2013 09:28:01 +0000
(11:28 +0200)
Otherwise, array->esize is promoted to int and if array->esize * num
results in a value > 0x7fffffff the return value would be incorrect due
the implicit sign extension when getting cast to size_t.
src/libstrongswan/collections/array.c
patch
|
blob
|
history
diff --git
a/src/libstrongswan/collections/array.c
b/src/libstrongswan/collections/array.c
index
d92eaac
..
387e2a5
100644
(file)
--- a/
src/libstrongswan/collections/array.c
+++ b/
src/libstrongswan/collections/array.c
@@
-49,7
+49,7
@@
struct array_t {
/**
* Get the actual size of a number of elements
*/
-static size_t get_size(array_t *array,
in
t num)
+static size_t get_size(array_t *array,
u_int32_
t num)
{
if (array->esize)
{