summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Anholt <anholt@freebsd.org>2004-08-14 00:03:32 +0000
committerEric Anholt <anholt@freebsd.org>2004-08-14 00:03:32 +0000
commit2376ec4ef8d280cf6fba44ba0163989eff739187 (patch)
treed6c368c034f552f197d9ec418ddd41dc194e44b9
parent211c37e250af6f8645a247ef1cce4dee041f3fd1 (diff)
Hopefully proper fix for corrupted driver name in memcontrol list.
Reported by: Jung-uk Kim <jkim@niksun.com>
-rw-r--r--bsd-core/drm_memory.c4
-rw-r--r--bsd/drm_memory.h4
2 files changed, 4 insertions, 4 deletions
diff --git a/bsd-core/drm_memory.c b/bsd-core/drm_memory.c
index c871274e..26adb085 100644
--- a/bsd-core/drm_memory.c
+++ b/bsd-core/drm_memory.c
@@ -138,7 +138,7 @@ DRM(mtrr_add)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_UPDATE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
@@ -152,7 +152,7 @@ DRM(mtrr_del)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_REMOVE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
#elif defined(__NetBSD__)
diff --git a/bsd/drm_memory.h b/bsd/drm_memory.h
index c871274e..26adb085 100644
--- a/bsd/drm_memory.h
+++ b/bsd/drm_memory.h
@@ -138,7 +138,7 @@ DRM(mtrr_add)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_UPDATE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
@@ -152,7 +152,7 @@ DRM(mtrr_del)(unsigned long offset, size_t size, int flags)
mrdesc.mr_len = size;
mrdesc.mr_flags = flags;
act = MEMRANGE_SET_REMOVE;
- bcopy(DRIVER_NAME, &mrdesc.mr_owner, strlen(DRIVER_NAME));
+ strlcpy(mrdesc.mr_owner, DRIVER_NAME, sizeof(mrdesc.mr_owner));
return mem_range_attr_set(&mrdesc, &act);
}
#elif defined(__NetBSD__)