ECC-1127: Crash: Trying to print expandedOriginalCodes with bufr_ls

This commit is contained in:
Shahram Najm 2020-06-28 21:33:35 +01:00
parent b264ec902f
commit 03feb61043
1 changed files with 7 additions and 0 deletions

View File

@ -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];