From 1c195ab280da561f38e54449e4eb3d6882c69b3b Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Wed, 25 Feb 2009 17:48:40 +0200 Subject: Fix strncpy length parameters to avoid non-nul-terminated strings --- test/hciemu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/hciemu.c b/test/hciemu.c index 43cec1ed..9f651bc4 100644 --- a/test/hciemu.c +++ b/test/hciemu.c @@ -1314,7 +1314,8 @@ int main(int argc, char *argv[]) vdev.features[7] = 0x80; memset(vdev.name, 0, sizeof(vdev.name)); - strncpy((char *) vdev.name, "BlueZ (Virtual HCI)", sizeof(vdev.name)); + strncpy((char *) vdev.name, "BlueZ (Virtual HCI)", + sizeof(vdev.name) - 1); vdev.dev_class[0] = 0x00; vdev.dev_class[1] = 0x00; -- cgit