On Sun, Aug 2, 2009 at 12:07 AM, Charles Plessy
<plessy@debian.org> wrote:
Le Thu, Jul 30, 2009 at 03:25:53PM -0400, Adam Phillippy a écrit :
> This patch looks fine. I saw it awhile back, but it got lost in the
> shuffle and was never applied. I'm on vacation right now, but I'll apply
> it to our distribution when I return.
Thank you very much. In the meantime, an improved version was prepared by Boyd
Stephen Smith Jr. I updated our subversion repository accordingly, and you can
retreive it with the following link:
The difference with the previous patch is the following:
int Errors, Tmp;
long int i, j, Ct;
- assert ( D_buf = (int *) calloc ( (M+1)*(N+1), sizeof(int) ) ) ;
+ assert ( SIZE_MAX / (M+1) >= (N+1) ) ;
+ D_buf = (int *) calloc ( (M+1)*(N+1), sizeof(int) ) ;
+ assert ( D_buf ) ;
D = &D_buf ;
- assert ( Op_buf = (char *) calloc ( (M+1)*(N+1), sizeof(char) ) ) ;
+ Op_buf = (char *) calloc ( (M+1)*(N+1), sizeof(char) ) ;
+ assert ( Op_buf ) ;
Op = &Op_buf ;
- assert ( Show_A = (char *) calloc ( 2*(M+1) , sizeof(char) ) ) ;
- assert ( Show_B = (char *) calloc ( 2*(N+1) , sizeof(char) ) ) ;
+
+ assert ( SIZE_MAX >> 1 >= (M+1) ) ;
+ Show_A = (char *) calloc ( 2*(M+1) , sizeof(char) ) ;
+ assert ( Show_A ) ;
+ Show_B = (char *) calloc ( 2*(N+1) , sizeof(char) ) ;
+ assert ( Show_B ) ;
D [0] [0] = 0;
Op [0] [0] = 'a';
Have a nice vacation !
--