]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
AOSP: Ignore quotes in safe_print().
authorJeff Sharkey <jsharkey@android.com>
Fri, 1 Jun 2018 16:49:40 +0000 (10:49 -0600)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 18 Aug 2018 19:59:58 +0000 (15:59 -0400)
If the value being printed has embedded quotes ("), then printing
those quotes could confuse other tools when parsing the value.

This is the simplest CL to fix the security issue, and we can circle
back to think about more robust escaping in a future CL.

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Bug: 80436257
Test: manual
Change-Id: Ica17f2c5701573bceafe34f20110d230a3925483
From AOSP commit: efe90c297a8df591c051fdbfacb92b5283390bba

misc/blkid.c

index 96fffae491c49418af7feb634a6b3489afe2e1f8..472f0179ee99ba28c51c2ce48561394482da753b 100644 (file)
@@ -87,7 +87,9 @@ static void safe_print(const char *cp, int len)
                        fputc('^', stdout);
                        ch ^= 0x40; /* ^@, ^A, ^B; ^? for DEL */
                }
-               fputc(ch, stdout);
+               if (ch != '"') {
+                       fputc(ch, stdout);
+               }
        }
 }