[systemd-commits] src/core

Kay Sievers kay at kemper.freedesktop.org
Wed Jul 10 15:14:56 PDT 2013


 src/core/shutdown.c |   11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

New commits:
commit 8577e67245fc5d38bfdc32349388769895202bc4
Author: Kay Sievers <kay at vrfy.org>
Date:   Thu Jul 11 00:13:46 2013 +0200

    shutdown: fix /proc/cmdline reading of 'quiet'

diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index c02a14d..fe7a073 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -144,11 +144,18 @@ int main(int argc, char *argv[]) {
                 char *w, *state;
                 size_t l;
 
-                FOREACH_WORD_QUOTED(w, l, line, state)
-                        if (streq(w, "quiet")) {
+                FOREACH_WORD_QUOTED(w, l, line, state) {
+                        _cleanup_free_ char *word;
+
+                        word = strndup(w, l);
+                        if (!word)
+                                break;
+
+                        if (streq(word, "quiet")) {
                                 log_set_max_level(LOG_WARNING);
                                 break;
                         }
+                }
         }
 
         log_parse_environment();



More information about the systemd-commits mailing list