diff options
author | Seung-Woo Kim <sw0312.kim@samsung.com> | 2014-12-05 19:23:57 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2014-12-05 19:23:59 +0900 |
commit | 41514f4effa0efc1e49194689ba3fc8e320dd1ba (patch) | |
tree | 50b6714883a415a3f965c742bc1b55fdda18b9cf /drivers | |
parent | ed56e84cfe2c1bcde50d217b4b314092c9073446 (diff) | |
download | linux-3.10-41514f4effa0efc1e49194689ba3fc8e320dd1ba.tar.gz linux-3.10-41514f4effa0efc1e49194689ba3fc8e320dd1ba.tar.bz2 linux-3.10-41514f4effa0efc1e49194689ba3fc8e320dd1ba.zip |
misc: modem_if: replace memcpy for string to strncpy to fix overflow
The memcpy with string source and size larger than string length
causes data overflow. So this patch replaces memcpy to strncpy to
fix data overflow.
Change-Id: Ibc326bdf0a1235c67013576ab9d8f170e8711344
Signed-off-by: Seung-Woo Kim <sw0312.kim@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/misc/modem_if/tizen_modem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/misc/modem_if/tizen_modem.c b/drivers/misc/modem_if/tizen_modem.c index 07ef592e7b6..bf2626e0e15 100644 --- a/drivers/misc/modem_if/tizen_modem.c +++ b/drivers/misc/modem_if/tizen_modem.c @@ -114,7 +114,7 @@ static struct modem_shared *create_modem_shared_data(void) return NULL; } memset(msd->storage.addr, 0, MAX_MIF_BUFF_SIZE); - memcpy(msd->storage.addr, MIF_SEPARATOR, MAX_MIF_SEPA_SIZE); + strncpy(msd->storage.addr, MIF_SEPARATOR, MAX_MIF_SEPA_SIZE - 1); msd->storage.addr += MAX_MIF_SEPA_SIZE; spin_lock_init(&msd->lock); |