]> git.ipfire.org Git - thirdparty/dhcpcd.git/commitdiff
Be more safe, escape * ? [ # ? = % as well.
authorRoy Marples <roy@marples.name>
Sun, 28 Sep 2014 20:50:43 +0000 (20:50 +0000)
committerRoy Marples <roy@marples.name>
Sun, 28 Sep 2014 20:50:43 +0000 (20:50 +0000)
dhcp-common.c

index c692a1adb2ace5505d346a65490ee58e596b7de0..353d48350154fee214de04ff4eb49a4c4c0b54d8 100644 (file)
@@ -302,6 +302,7 @@ decode_rfc3397(char *out, size_t len, const uint8_t *p, size_t pl)
  * space is not escaped.
  */
 #define ESCAPE_CHARS   "|&;<>()$`\\\"'\t\n"
+#define ESCAPE_EXTRA   "*?[#~=%"
 
 /*
  * Prints a chunk of data to a string.
@@ -331,7 +332,7 @@ print_string(char *s, size_t len, int flags, const uint8_t *data, size_t dl)
                }
                if (flags)
                        ve = svis(v, c, VIS_CSTYLE | VIS_OCTAL,
-                           data <= e ? *data : 0, ESCAPE_CHARS);
+                           data <= e ? *data : 0, ESCAPE_CHARS ESCAPE_GLOB);
                else
                        ve = vis(v, c, VIS_CSTYLE | VIS_OCTAL,
                            data <= e ? *data : 0);