aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar pavelxdd <pavel.otchertsov@gmail.com>2018-10-22 22:12:11 +0300
committerGravatar sfan5 <sfan5@live.de>2018-10-25 13:49:49 +0200
commitbdec4421e69e62403a3bab3fdafd8b11ba0a070b (patch)
treedcca8dcf0688bcea15188590748e1f069b4b0d76
parentda1073c247523d07d0485348447fcc02000afee8 (diff)
stream_smb: make sure the string is NULL-terminated after strncpy
strncpy does not guarantee that the string will be NULL-terminated.
-rw-r--r--stream/stream_smb.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/stream/stream_smb.c b/stream/stream_smb.c
index 269974f18b..bc51796bbc 100644
--- a/stream/stream_smb.c
+++ b/stream/stream_smb.c
@@ -43,6 +43,7 @@ static void smb_auth_fn(const char *server, const char *share,
char *password, int pwmaxlen)
{
strncpy(workgroup, "LAN", wgmaxlen - 1);
+ workgroup[wgmaxlen - 1] = '\0';
}
static int control(stream_t *s, int cmd, void *arg) {