]> git.rkrishnan.org Git - pihpsdr.git/commitdiff
Do not overflow local microphone name buffer.
authorc vw <dl1ycf@darc.de>
Sun, 13 Sep 2020 14:40:13 +0000 (16:40 +0200)
committerc vw <dl1ycf@darc.de>
Sun, 13 Sep 2020 14:40:13 +0000 (16:40 +0200)
audio.c

diff --git a/audio.c b/audio.c
index 3c4581a6eccb6d855651e37b109bc527d0c4d6af..931bb1451e88b787905008ce84bca52fefc4a4d5 100644 (file)
--- a/audio.c
+++ b/audio.c
@@ -182,7 +182,7 @@ g_print("audio_open_input: %s\n",transmitter->microphone_name);
 
   g_print("audio_open_input: mic_buffer_size=%d\n",mic_buffer_size);
   i=0;
-  while(transmitter->microphone_name[i]!=' ') {
+  while(i<63 && transmitter->microphone_name[i]!=' ') {
     hw[i]=transmitter->microphone_name[i];
     i++;
   }