From: Volker Lendecke Date: Thu, 4 Oct 2018 08:57:47 +0000 (+0200) Subject: tdb_unpack: Convert to size_t for internal calculations X-Git-Tag: tdb-1.3.17~1399 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f211efb3a79f24d9542e1c2472633cce2334208;p=thirdparty%2Fsamba.git tdb_unpack: Convert to size_t for internal calculations Signed-off-by: Volker Lendecke Reviewed-by: Jeremy Allison --- diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index 80e66e0a108..9f39fcb4df3 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -145,20 +145,20 @@ size_t tdb_pack(uint8_t *buf, int bufsize, const char *fmt, ...) integers and strings. ****************************************************************************/ -int tdb_unpack(const uint8_t *buf, int bufsize, const char *fmt, ...) +int tdb_unpack(const uint8_t *buf, int in_bufsize, const char *fmt, ...) { va_list ap; uint8_t *bt; uint16_t *w; uint32_t *d; - int len; + size_t bufsize = in_bufsize; + size_t len; int *i; void **p; char *s, **b, **ps; char c; const uint8_t *buf0 = buf; const char *fmt0 = fmt; - int bufsize0 = bufsize; va_start(ap, fmt); @@ -249,7 +249,7 @@ int tdb_unpack(const uint8_t *buf, int bufsize, const char *fmt, ...) va_end(ap); DEBUG(18,("tdb_unpack(%s, %d) -> %d\n", - fmt0, bufsize0, (int)PTR_DIFF(buf, buf0))); + fmt0, in_bufsize, (int)PTR_DIFF(buf, buf0))); return PTR_DIFF(buf, buf0);