]> git.ipfire.org Git - thirdparty/kmod.git/commitdiff
libkmod-config: more chars allowed as space
authorLucas De Marchi <lucas.demarchi@intel.com>
Wed, 10 Mar 2021 16:33:01 +0000 (08:33 -0800)
committerLucas De Marchi <lucas.demarchi@intel.com>
Wed, 10 Mar 2021 16:33:01 +0000 (08:33 -0800)
Recently in a discussion I noticed that kernel allows more chars to be
considered as space in the kernel command line. Switch to the equivalent
of isspace() instead of considering only ' '.

libkmod/libkmod-config.c

index 2873f061dc9eef378380592d8aeb99700a2f4a8d..4fdd40f86deaa38aa5a04b83e5d93911785b9bc0 100644 (file)
@@ -543,11 +543,14 @@ static int kmod_config_parse_kcmdline(struct kmod_config *config)
 
                        break;
                case '\0':
-               case '\n':
-                       /* Stop iterating on new chars */
                        iter = false;
                        /* fall-through */
                case ' ':
+               case '\n':
+               case '\t':
+               case '\v':
+               case '\f':
+               case '\r':
                        if (is_quoted && state == STATE_VALUE) {
                                /* no state change*/;
                        } else if (is_quoted) {