1
0
mirror of https://github.com/mpv-player/mpv synced 2025-01-12 01:49:33 +00:00

stream_smb: make sure the string is NULL-terminated after strncpy

strncpy does not guarantee that the string will be NULL-terminated.
This commit is contained in:
pavelxdd 2018-10-22 22:12:11 +03:00 committed by sfan5
parent da1073c247
commit bdec4421e6

View File

@ -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) {