diff options
-rw-r--r-- | source3/lib/util_tdb.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/lib/util_tdb.c b/source3/lib/util_tdb.c index 65e46119b4..fb586f45d2 100644 --- a/source3/lib/util_tdb.c +++ b/source3/lib/util_tdb.c @@ -417,7 +417,7 @@ int tdb_unpack(const uint8 *buf, int bufsize, const char *fmt, ...) break; case 'f': /* null-terminated string */ s = va_arg(ap,char *); - len = strlen((const char *)buf) + 1; + len = strnlen((const char *)buf, bufsize) + 1; if (bufsize < len || len > sizeof(fstring)) goto no_space; memcpy(s, buf, len); |