commit 4c46162717b3f588bfe27fb33e4badef4cf709cb
parent 437c6f3ce05b76a6c7b3faf2a3dbcb15c8f659d8
Author: Christophe Coustet <christophe.coustet@meso-star.com>
Date: Thu, 7 Apr 2022 15:09:33 +0200
BugFix: fail properly when a non-program name is used where a program is expected
Diffstat:
1 file changed, 6 insertions(+), 0 deletions(-)
diff --git a/src/stardis-parsing.c b/src/stardis-parsing.c
@@ -523,6 +523,12 @@ get_prog_common
if(res == RES_OK) res = RES_BAD_ARG;
goto end;
}
+ else if(desc->type != DESC_PROGRAM) {
+ logger_print(stardis->logger, LOG_ERROR,
+ "Is not a PROGRAM: %s\n", lib_name);
+ if(res == RES_OK) res = RES_BAD_ARG;
+ goto end;
+ }
*program = desc->d.program;
/* get the mandatory user-defined functions from the library */
GET_LIB_SYMBOL_BASE(create, (*program)->lib_handle, stardis_create_data, 0);