diff options
author | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-07 18:12:48 +1100 |
---|---|---|
committer | Mark Farrugia <mark.farrugia@fiberdyne.com.au> | 2018-10-26 17:27:37 +1100 |
commit | aeb43d0374f4b1fb383da088b198de55f139a280 (patch) | |
tree | 3799c41bc7b230a3eb2a98ce05fd079a0cd02681 /core.c | |
parent | 86c77302e07b229d6723dc1f8e3da02765cff1f1 (diff) |
Ensure no buffer overflow when setting card description
Sanity guard the sound card string buffers with strncpy
Signed-off-by: Mark Farrugia <mark.farrugia@fiberdyne.com.au>
Diffstat (limited to 'core.c')
-rw-r--r-- | core.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -428,9 +428,10 @@ static int __init core_init(void) goto exit_class_container; } - strcpy(core.card->driver, "avirt-alsa-device"); - strcpy(core.card->shortname, "avirt"); - strcpy(core.card->longname, "A virtual sound card driver for ALSA"); + strncpy(core.card->driver, "avirt-alsa-dev", 16); + strncpy(core.card->shortname, "avirt", 32); + strncpy(core.card->longname, "A virtual sound card driver for ALSA", + 80); avirt_audiopath_kset = kset_create_and_add("audiopaths", NULL, &core.dev->kobj); |