From e4a78f9f5dfc2d9255d963fd518a5f00cb5c4e3f Mon Sep 17 00:00:00 2001 From: Rafael Garcia-Suarez Date: Wed, 15 Feb 2006 10:45:44 +0000 Subject: Fix another couple of potential buffer overflows --- mdk-stage1/tools.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'mdk-stage1/tools.c') diff --git a/mdk-stage1/tools.c b/mdk-stage1/tools.c index 36185bcfb..17a4774fd 100644 --- a/mdk-stage1/tools.c +++ b/mdk-stage1/tools.c @@ -451,8 +451,7 @@ int kernel_version(void) int try_mount(char * dev, char * location) { char device_fullname[50]; - strcpy(device_fullname, "/dev/"); - strcat(device_fullname, dev); + snprintf(device_fullname, sizeof(device_fullname), "/dev/%s", dev); if (my_mount(device_fullname, location, "ext2", 0) == -1 && my_mount(device_fullname, location, "vfat", 0) == -1 && -- cgit v1.2.1