scd: Fix status info encoding.
authorNIIBE Yutaka <gniibe@fsij.org>
Mon, 14 Nov 2016 01:25:43 +0000 (10:25 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Mon, 14 Nov 2016 01:25:43 +0000 (10:25 +0900)
* scd/command.c (send_status_info): Do percent plus encoding correctly.

--

Reported-by: David Härdeman <david@hardeman.nu>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/command.c

index 3584593..e771a74 100644 (file)
@@ -2137,7 +2137,8 @@ send_status_info (ctrl_t ctrl, const char *keyword, ...)
         }
       for ( ; valuelen && n < DIM (buf)-2; n++, valuelen--, value++)
         {
-          if (*value < ' ' || *value == '+')
+          if (*value == '+' || *value == '\"' || *value == '%'
+              || *value < ' ')
             {
               sprintf (p, "%%%02X", *value);
               p += 3;