bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] Use size_t for variable list size and length


From: Roman Rakus
Subject: [PATCH] Use size_t for variable list size and length
Date: Thu, 29 Nov 2012 11:07:52 +0100

see 
https://www.securecoding.cert.org/confluence/display/seccode/INT32-C.+Ensure+that+operations+on+signed+integers+do+not+result+in+overflow

Signed-off-by: Roman Rakus <address@hidden>
---
 variables.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/variables.h b/variables.h
index 84e92bb..7a6bd6f 100644
--- a/variables.h
+++ b/variables.h
@@ -95,8 +95,8 @@ typedef struct variable {
 
 typedef struct _vlist {
   SHELL_VAR **list;
-  int list_size;       /* allocated size */
-  int list_len;                /* current number of entries */
+  size_t list_size;    /* allocated size */
+  size_t list_len;     /* current number of entries */
 } VARLIST;
 
 /* The various attributes that a given variable can have. */
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]