[vlc-devel] commit: Fix a segfault (buffer overflow for win32 only). ( Rémi Duraffort )

git version control git at videolan.org
Sat Jun 27 13:17:26 CEST 2009


vlc | branch: 0.9-bugfix | Rémi Duraffort <ivoire at videolan.org> | Wed Jun 24 16:20:40 2009 +0200| [f2645e92a6ba8ce4a2e474a61de579bfa79d8998] | committer: Rémi Denis-Courmont 

Fix a segfault (buffer overflow for win32 only).

(cherry picked from commit e60a9038b13b5eb805a76755efc5c6d5e080180f)

Signed-off-by: Rémi Denis-Courmont <remi at remlab.net>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f2645e92a6ba8ce4a2e474a61de579bfa79d8998
---

 modules/access/smb.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/access/smb.c b/modules/access/smb.c
index b5f518b..de638e9 100644
--- a/modules/access/smb.c
+++ b/modules/access/smb.c
@@ -478,7 +478,7 @@ static void Win32AddConnection( access_t *p_access, char *psz_path,
             strlcpy( psz_share, psz_parser, sizeof( psz_share ) );
    }
 
-    sprintf( psz_remote, "\\\\%s\\%s", psz_server, psz_share );
+    snprintf( psz_remote, sizeof( psz_remote ), "\\\\%s\\%s", psz_server, psz_share );
     net_resource.lpRemoteName = psz_remote;
 
     i_result = OurWNetAddConnection2( &net_resource, psz_pwd, psz_user, 0 );




More information about the vlc-devel mailing list