summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Roitzsch <mroi@users.sourceforge.net>2004-07-22 14:23:42 +0000
committerMichael Roitzsch <mroi@users.sourceforge.net>2004-07-22 14:23:42 +0000
commitc7f27f9a3142e4eff084384694cc8f6f651129d9 (patch)
tree6727b63c5271947008003ea81729c083eb0026fc
parentf41851a6fde52ce317547ca361168553b29e2836 (diff)
downloadxine-lib-c7f27f9a3142e4eff084384694cc8f6f651129d9.tar.gz
xine-lib-c7f27f9a3142e4eff084384694cc8f6f651129d9.tar.bz2
long paths to the vidix drivers would have overrun the path buffer
CVS patchset: 6835 CVS date: 2004/07/22 14:23:42
-rw-r--r--src/video_out/vidix/vidixlib.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/video_out/vidix/vidixlib.c b/src/video_out/vidix/vidixlib.c
index a513c9811..37af2035b 100644
--- a/src/video_out/vidix/vidixlib.c
+++ b/src/video_out/vidix/vidixlib.c
@@ -138,8 +138,9 @@ static int vdl_probe_driver(VDL_HANDLE stream,const char *path,const char *name,
unsigned (*_ver)(void);
int (*_probe)(int,int);
int (*_cap)(vidix_capability_t*);
- strcpy(drv_name,path);
- strcat(drv_name,name);
+ strncpy(drv_name,path,sizeof(drv_name));
+ drv_name[sizeof(drv_name) - 1] = '\0';
+ strncat(drv_name,name,sizeof(drv_name) - strlen(drv_name) - 1);
if(verbose) printf("vidixlib: PROBING: %s\n",drv_name);
{
@@ -226,8 +227,9 @@ VDL_HANDLE vdlOpen(const char *path,const char *name,unsigned cap,int verbose)
unsigned char *arg_sep;
arg_sep = strchr(name,':');
if(arg_sep) { *arg_sep='\0'; drv_args = &arg_sep[1]; }
- strcpy(drv_name,path);
- strcat(drv_name,name);
+ strncpy(drv_name,path,sizeof(drv_name));
+ drv_name[sizeof(drv_name) - 1] = '\0';
+ strncat(drv_name,name,sizeof(drv_name) - strlen(drv_name) - 1);
{
const char* slash = strrchr(drv_name, '/');
if (slash) {