Commit b5f44638 authored by Simon Morlat's avatar Simon Morlat
Browse files

fix INVALID WRITE in text stream tester

parent 37d0ba6e
...@@ -53,7 +53,7 @@ typedef struct _text_stream_tester_stats_t { ...@@ -53,7 +53,7 @@ typedef struct _text_stream_tester_stats_t {
OrtpEvQueue *q; OrtpEvQueue *q;
rtp_stats_t rtp; rtp_stats_t rtp;
int number_of_received_char; int number_of_received_char;
char received_chars[128]; char received_chars[256];
} text_stream_tester_stats_t; } text_stream_tester_stats_t;
typedef struct _text_stream_tester_t { typedef struct _text_stream_tester_t {
...@@ -119,7 +119,11 @@ static void real_time_text_character_received(void *userdata, struct _MSFilter * ...@@ -119,7 +119,11 @@ static void real_time_text_character_received(void *userdata, struct _MSFilter *
if (tst->stats.q != NULL) { if (tst->stats.q != NULL) {
RealtimeTextReceivedCharacter *data = (RealtimeTextReceivedCharacter *)arg; RealtimeTextReceivedCharacter *data = (RealtimeTextReceivedCharacter *)arg;
ms_message("Received RTT char: %lu, %c", (unsigned long)data->character, (char)data->character); ms_message("Received RTT char: %lu, %c", (unsigned long)data->character, (char)data->character);
tst->stats.received_chars[tst->stats.number_of_received_char++] = (char)data->character; if (tst->stats.number_of_received_char < sizeof(tst->stats.received_chars)-1){
tst->stats.received_chars[tst->stats.number_of_received_char++] = (char)data->character;
}else{
ms_fatal("tst->stats.received_chars buffer overflow");
}
} }
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment