X-Git-Url: http://woldlab.caltech.edu/gitweb/?p=samtools.git;a=blobdiff_plain;f=debian%2Fpatches%2Frazip-oom-check;fp=debian%2Fpatches%2Frazip-oom-check;h=d4cc2998081d4e45d7a22a78c8f30e45e79270e3;hp=0000000000000000000000000000000000000000;hb=ee9d1abc1046f46d40357e56074d64ad9ef050b7;hpb=2d64e9d38d51c80cc1d23e391f34204434ac73f4 diff --git a/debian/patches/razip-oom-check b/debian/patches/razip-oom-check new file mode 100644 index 0000000..d4cc299 --- /dev/null +++ b/debian/patches/razip-oom-check @@ -0,0 +1,18 @@ +--- a/razip.c 2011-10-20 11:05:21.020305754 -0700 ++++ b/razip.c 2011-10-20 11:48:26.208271871 -0700 +@@ -79,7 +79,13 @@ + if(pstdout){ + f_dst = fileno(stdout); + } else { +- char *name = malloc(sizeof(strlen(argv[optind]) + 5)); ++ char *name = (char *)malloc(sizeof(char) * (strlen(argv[optind]) + 5)); ++ if (name == NULL) ++ { ++ fprintf(stderr, " -- Out of memory --\n"); ++ return 1; ++ } ++ + strcpy(name, argv[optind]); + strcat(name, ".rz"); + f_dst = write_open(name, is_forced); +