mirror of https://github.com/ecmwf/eccodes.git
ECC-1127: Crash: Trying to print expandedOriginalCodes with bufr_ls
This commit is contained in:
parent
b264ec902f
commit
03feb61043
|
@ -571,6 +571,13 @@ static int unpack_long(grib_accessor* a, long* val, size_t* len)
|
|||
if (err)
|
||||
return 0;
|
||||
|
||||
if (*len < self->tableCodesSize) {
|
||||
grib_context_log(a->context, GRIB_LOG_ERROR,
|
||||
" wrong size (%ld) for %s it contains %d values ", *len, a->name, self->tableCodesSize);
|
||||
*len = 0;
|
||||
return GRIB_ARRAY_TOO_SMALL;
|
||||
}
|
||||
|
||||
for (i = 0; i < self->tableCodesSize; i++)
|
||||
val[i] = self->tableCodes[i];
|
||||
|
||||
|
|
Loading…
Reference in New Issue