public inbox for glibc-cvs@sourceware.org
help / color / mirror / Atom feed
* [glibc] elf: Emit warning if tunable is ill-formatted
@ 2023-11-21 20:49 Adhemerval Zanella
  0 siblings, 0 replies; only message in thread
From: Adhemerval Zanella @ 2023-11-21 20:49 UTC (permalink / raw)
  To: glibc-cvs

https://sourceware.org/git/gitweb.cgi?p=glibc.git;h=eb9291aaa6ff6af158a1436b881ef8b834559621

commit eb9291aaa6ff6af158a1436b881ef8b834559621
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Mon Nov 6 17:25:41 2023 -0300

    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 <siddhesh@sourceware.org>

Diff:
---
 elf/dl-tunables.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/elf/dl-tunables.c b/elf/dl-tunables.c
index 4d6a143f06..83265bc00b 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);

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-11-21 20:49 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-21 20:49 [glibc] elf: Emit warning if tunable is ill-formatted Adhemerval Zanella

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).