From bdec4421e69e62403a3bab3fdafd8b11ba0a070b Mon Sep 17 00:00:00 2001 From: pavelxdd Date: Mon, 22 Oct 2018 22:12:11 +0300 Subject: stream_smb: make sure the string is NULL-terminated after strncpy strncpy does not guarantee that the string will be NULL-terminated. --- stream/stream_smb.c | 1 + 1 file changed, 1 insertion(+) 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) { -- cgit v1.2.3