mirror of
https://github.com/mpv-player/mpv
synced 2025-01-12 09:59:44 +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:
parent
da1073c247
commit
bdec4421e6
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user