Skip to content

Commit

Permalink
Merge pull request #120 from cancerit/feature/umn-bughunt
Browse files Browse the repository at this point in the history
removed free-ing of unallocated memory, and prevented a buffer overrun in strcat due to suffcient space not being allocated for the \t and the null terminator, which were causing generateCavemanUMNormVCF to fail
  • Loading branch information
blex-max authored Jun 13, 2024
2 parents f3986b2 + f520b87 commit eeeb89d
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 4 deletions.
2 changes: 0 additions & 2 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,6 @@ else
touch $SETUP_DIR/caveman.success
fi

exit

# cleanup all junk
rm -rf $SETUP_DIR
make clean
Expand Down
3 changes: 1 addition & 2 deletions src/generateCavemanVCFUnmatchedNormalPanel.c
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@ List *gen_panel_get_list_of_samples_and_locs(){
char *bamchar = NULL;
samples = List_create();
//Iterate through list of sample_names using comma as separator
char *new_sample_names = malloc((strlen(sample_names)+1) * sizeof(char));
char *new_sample_names = calloc((strlen(sample_names)+2), sizeof(char));
check_mem(new_sample_names);
sampchar = strtok(sample_names,",");
while(sampchar != NULL){
Expand All @@ -316,7 +316,6 @@ List *gen_panel_get_list_of_samples_and_locs(){
sampchar = strtok(NULL,",");
List_push(samples,this_samp);
}
free(sampchar);

bamchar = strtok(bam_file_locs,",");
LIST_FOREACH(samples, first, next, cur){
Expand Down

0 comments on commit eeeb89d

Please sign in to comment.