From: Todd C. Miller Date: Sun, 22 Nov 2015 16:22:38 +0000 (-0700) Subject: Use size_t for length parameters in the fill functions used by the X-Git-Tag: SUDO_1_8_16^2~102 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=604d350344d248ed971158ca10e20fc9340b83e7;p=sudo Use size_t for length parameters in the fill functions used by the lexer. --- diff --git a/plugins/sudoers/toke.h b/plugins/sudoers/toke.h index 0a870e6df..c6a2db579 100644 --- a/plugins/sudoers/toke.h +++ b/plugins/sudoers/toke.h @@ -17,10 +17,10 @@ #ifndef SUDOERS_TOKE_H #define SUDOERS_TOKE_H -bool append(const char *, int); -bool fill_args(const char *, int, int); -bool fill_cmnd(const char *, int); -bool fill_txt(const char *, int, int); +bool append(const char *, size_t); +bool fill_args(const char *, size_t, int); +bool fill_cmnd(const char *, size_t); +bool fill_txt(const char *, size_t, size_t); bool ipv6_valid(const char *s); int sudoers_trace_print(const char *msg); void sudoerserror(const char *); diff --git a/plugins/sudoers/toke_util.c b/plugins/sudoers/toke_util.c index b3073a5dd..977028ba8 100644 --- a/plugins/sudoers/toke_util.c +++ b/plugins/sudoers/toke_util.c @@ -45,7 +45,7 @@ static int arg_len = 0; static int arg_size = 0; bool -fill_txt(const char *src, int len, int olen) +fill_txt(const char *src, size_t len, size_t olen) { char *dst; int h; @@ -81,7 +81,7 @@ fill_txt(const char *src, int len, int olen) } bool -append(const char *src, int len) +append(const char *src, size_t len) { int olen = 0; debug_decl(append, SUDOERS_DEBUG_PARSER) @@ -96,10 +96,10 @@ append(const char *src, int len) ((c) == ',' || (c) == ':' || (c) == '=' || (c) == ' ' || (c) == '\t' || (c) == '#') bool -fill_cmnd(const char *src, int len) +fill_cmnd(const char *src, size_t len) { char *dst; - int i; + size_t i; debug_decl(fill_cmnd, SUDOERS_DEBUG_PARSER) arg_len = arg_size = 0; @@ -125,7 +125,7 @@ fill_cmnd(const char *src, int len) } bool -fill_args(const char *s, int len, int addspace) +fill_args(const char *s, size_t len, int addspace) { int new_len; char *p;