--- fs/cifs/connect.c.stable 2012-10-16 16:44:50.000000000 +0200 +++ fs/cifs/connect.c.fixed 2012-10-16 18:56:37.000000000 +0200 @@ -1204,6 +1204,7 @@ char *string = NULL; char *tmp_end, *value; char delim; + char *p, *q; separator[0] = ','; separator[1] = 0; @@ -1662,12 +1663,12 @@ printk(KERN_WARNING "CIFS: no memory for UNC\n"); goto cifs_parse_mount_err; } - strcpy(vol->UNC, string); - if (strncmp(string, "//", 2) == 0) { - vol->UNC[0] = '\\'; - vol->UNC[1] = '\\'; - } else if (strncmp(string, "\\\\", 2) != 0) { + for (p = string, q = vol->UNC; *p; ++p, ++q) { + *q = *p == '/'? '\\' : *p; + } + *q = '\0'; + if (strncmp(vol->UNC, "\\\\", 2) != 0) { printk(KERN_WARNING "CIFS: UNC Path does not " "begin with // or \\\\\n"); goto cifs_parse_mount_err;