From 408e1862415fd7cc370e2e9cd3fba1c53c978fd2 Mon Sep 17 00:00:00 2001 From: Shahram Najm Date: Tue, 22 Aug 2023 20:35:14 +0100 Subject: [PATCH] Check result of grib_unpack_string --- src/grib_accessor_class_ascii.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/grib_accessor_class_ascii.cc b/src/grib_accessor_class_ascii.cc index 46d18b63d..035b2c9cc 100644 --- a/src/grib_accessor_class_ascii.cc +++ b/src/grib_accessor_class_ascii.cc @@ -229,7 +229,8 @@ static int unpack_double(grib_accessor* a, double* v, size_t* len) size_t l = sizeof(val); char* last = NULL; - grib_unpack_string(a, val, &l); + int err = grib_unpack_string(a, val, &l); + if (err) return err; *v = strtod(val, &last);