Changeset: 6c764974f9f0 for MonetDB URL: http://dev.monetdb.org/hg/MonetDB?cmd=changeset;node=6c764974f9f0 Modified Files: sql/backends/monet5/bam/bam_loader.c Branch: bamloader Log Message:
Fix stack smashing error by allocating a big enough buffer diffs (30 lines): diff --git a/sql/backends/monet5/bam/bam_loader.c b/sql/backends/monet5/bam/bam_loader.c --- a/sql/backends/monet5/bam/bam_loader.c +++ b/sql/backends/monet5/bam/bam_loader.c @@ -187,7 +187,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s sql_schema *s = NULL; sql_table *files_table = NULL; lng cur_file_id; - char buf_threads_msg[] = "There were reader threads that contained errors:\n"; + char buf_threads_msg[4096] = "There were reader threads that contained errors:\n"; int threads_msg_len = strlen(buf_threads_msg); int i, errnr; str msg = MAL_SUCCEED; @@ -355,7 +355,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s TO_LOG("<bam_loader> Waiting for reader threads to finish...\n"); /* Wait until all threads finish and collect their * messages. Though it is not very likely, it could be the - * case that more than 1 thread generate an error message (not + * case that more than 1 thread generates an error message (not * likely because threads exit once they notice that another * thread has failed). Therefore, we collect all error * messages in one big error string @@ -382,7 +382,7 @@ bam_loader(Client cntxt, MalBlkPtr mb, s * use MAX to make sure we don't add a * negative amount to threads_msg_len */ step = snprintf(msg + threads_msg_len, - 2048 - threads_msg_len, "* %s\n", + 4096 - threads_msg_len, "* %s\n", r_thread_data[i].msg); threads_msg_len += MAX(0, step); GDKfree(r_thread_data[i].msg); _______________________________________________ checkin-list mailing list checkin-list@monetdb.org https://www.monetdb.org/mailman/listinfo/checkin-list