Additional type checking in secrets API
authorDaniel Colascione <dancol@dancol.org>
Sat, 22 Feb 2014 00:47:42 +0000 (16:47 -0800)
committerDaniel Colascione <dancol@dancol.org>
Sat, 22 Feb 2014 00:47:42 +0000 (16:47 -0800)
lisp/ChangeLog
lisp/net/secrets.el

index 6fb5883..82c24f1 100644 (file)
@@ -1,3 +1,9 @@
+2014-02-22  Daniel Colascione  <dancol@dancol.org>
+
+       * net/secrets.el (secrets-create-item,secrets-search-items): Check
+       that attribute values are strings, avoiding the construction of
+       invalid dbus messages.
+
 2014-02-21  Juanma Barranquero  <lekktu@gmail.com>
 
        * emacs-lisp/gv.el: Avoid duplicating gv-expander and gv-setter in
index a0f30e3..9ba9bd0 100644 (file)
@@ -609,6 +609,8 @@ The object paths of the found items are returned as list."
       (while (consp (cdr attributes))
        (unless (keywordp (car attributes))
          (error 'wrong-type-argument (car attributes)))
+        (unless (stringp (cadr attributes))
+          (error 'wrong-type-argument (cadr attributes)))
        (setq props (add-to-list
                     'props
                     (list :dict-entry
@@ -647,6 +649,8 @@ The object path of the created item is returned."
        (while (consp (cdr attributes))
          (unless (keywordp (car attributes))
            (error 'wrong-type-argument (car attributes)))
+          (unless (stringp (cadr attributes))
+            (error 'wrong-type-argument (cadr attributes)))
          (setq props (add-to-list
                       'props
                       (list :dict-entry