mirror of https://github.com/ecmwf/eccodes.git
ECC-424: Do not allow non-BUFR messages for bufr_keys_iterator_new
This commit is contained in:
parent
dc422ec54c
commit
91fb3f14d7
|
@ -16,6 +16,12 @@ bufr_keys_iterator* codes_bufr_keys_iterator_new(grib_handle* h)
|
|||
|
||||
if (!h) return NULL;
|
||||
|
||||
if (h->product_kind != PRODUCT_BUFR) {
|
||||
grib_context_log(h->context, GRIB_LOG_ERROR,
|
||||
"Invalid keys iterator for message: please use codes_keys_iterator_new");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ki= (bufr_keys_iterator*)grib_context_malloc_clear(h->context,sizeof(bufr_keys_iterator));
|
||||
if (!ki) return NULL;
|
||||
|
||||
|
|
|
@ -23,6 +23,12 @@ grib_keys_iterator* grib_keys_iterator_new(grib_handle* h,unsigned long filter_f
|
|||
|
||||
if (!h) return NULL;
|
||||
|
||||
/*if (h->product_kind == PRODUCT_BUFR) {
|
||||
grib_context_log(h->context, GRIB_LOG_ERROR,
|
||||
"Invalid keys iterator for BUFR message: please use codes_bufr_keys_iterator_new");
|
||||
return NULL;
|
||||
}*/
|
||||
|
||||
ki= (grib_keys_iterator*)grib_context_malloc_clear(h->context,sizeof(grib_keys_iterator));
|
||||
if (!ki) return NULL;
|
||||
|
||||
|
|
Loading…
Reference in New Issue