From eaf3be4fb75f8dda3e2be044f096338aa3069ba2 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Sun, 8 Jan 2012 15:15:56 +0100 Subject: sam3u unique id: make sure string is zero-terminated --- usb-dfu-experiment/sam3u_chipid_usbserial.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'usb-dfu-experiment') diff --git a/usb-dfu-experiment/sam3u_chipid_usbserial.c b/usb-dfu-experiment/sam3u_chipid_usbserial.c index c62561e..b81e6b9 100644 --- a/usb-dfu-experiment/sam3u_chipid_usbserial.c +++ b/usb-dfu-experiment/sam3u_chipid_usbserial.c @@ -39,11 +39,13 @@ static int to_usb_string(unsigned char *out, int out_len, const char *in) static int chip_uid_to_usbstring(void) { - unsigned long uniqueID[4]; + unsigned char uniqueID[17]; int rc; + memset(uniqueID, 0, sizeof(uniqueID)); + FLASHD_Initialize(0); - rc = FLASHD_ReadUniqueID(uniqueID); + rc = FLASHD_ReadUniqueID((unsigned long *) uniqueID); if (rc != 0) return -EIO; -- cgit v1.2.3