Skip to content

Commit

Permalink
Fix Overflow on -U and -W sctrncpy;
Browse files Browse the repository at this point in the history
  • Loading branch information
lwvmobile committed May 21, 2024
1 parent bdcc67d commit a686f82
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -504,8 +504,8 @@ int main (int argc, char **argv)

//Specify M17 UDP Frame String Format, i.e., 'localhost:17000' or 'mycustomhost.xyz:17001'
case 'U':
strncpy(super.opts.m17_udp_input, optarg, 1024);
super.opts.m17_udp_input[1024] = '\0';
strncpy(super.opts.m17_udp_input, optarg, 1023);
super.opts.m17_udp_input[1023] = '\0';
break;

//Enable the Stream Voice Encoder
Expand All @@ -518,7 +518,7 @@ int main (int argc, char **argv)
case 'W':
super.opts.use_wav_out_rf = 1;
strncpy(super.wav.wav_out_file_rf, optarg, 1023);
super.wav.wav_out_file_rf[1024] = '\0';
super.wav.wav_out_file_rf[1023] = '\0';
fprintf (stderr, "RF Audio Wav File: %s \n", super.wav.wav_out_file_rf);
break;

Expand Down

0 comments on commit a686f82

Please sign in to comment.