From: Adhemerval Zanella Date: Mon, 6 Nov 2023 20:25:41 +0000 (-0300) Subject: elf: Emit warning if tunable is ill-formatted X-Git-Tag: glibc-2.39~255 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb9291aaa6ff6af158a1436b881ef8b834559621;p=thirdparty%2Fglibc.git elf: Emit warning if tunable is ill-formatted So caller knows that the tunable will be ignored. Checked on x86_64-linux-gnu. Reviewed-by: Siddhesh Poyarekar --- diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c index 4d6a143f06a..83265bc00b3 100644 --- a/elf/dl-tunables.c +++ b/elf/dl-tunables.c @@ -235,6 +235,12 @@ parse_tunables (char *valstring) { struct tunable_toset_t tunables[tunables_list_size]; int ntunables = parse_tunables_string (valstring, tunables); + if (ntunables == -1) + { + _dl_error_printf ( + "WARNING: ld.so: invalid GLIBC_TUNABLES `%s': ignored.\n", valstring); + return; + } for (int i = 0; i < ntunables; i++) tunable_initialize (tunables[i].t, tunables[i].value);