mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-03-31 21:15:33 +08:00
[g2clib] Fix sigfault if simunpack() is called with 0 values to unpack
Patch from Fedora 23 http://pkgs.fedoraproject.org/cgit/rpms/g2clib.git/tree/g2clib-simunpack.patch
This commit is contained in:
@@ -49,7 +49,7 @@ g2int simunpack(unsigned char *cpack,g2int *idrstmpl,g2int ndpts,g2float *fld)
|
||||
nbits = idrstmpl[3];
|
||||
itype = idrstmpl[4];
|
||||
|
||||
ifld=(g2int *)calloc(ndpts,sizeof(g2int));
|
||||
ifld=(g2int *)calloc((ndpts ? ndpts : 1),sizeof(g2int));
|
||||
if ( ifld == 0 ) {
|
||||
fprintf(stderr,"Could not allocate space in simunpack.\n Data field NOT upacked.\n");
|
||||
return(1);
|
||||
|
||||
Reference in New Issue
Block a user