about summary refs log tree commit homepage
path: root/ext
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2011-12-05 17:59:40 -0800
committerEric Wong <normalperson@yhbt.net>2011-12-05 17:59:40 -0800
commit3a47f23e74a681339f74b21b94241dcfe9542472 (patch)
treed29223babb471bbc1a2c42937aa917fab1035236 /ext
parentba72b12030864a05fc88bc94a3b699971cc70b0a (diff)
downloadclogger-3a47f23e74a681339f74b21b94241dcfe9542472.tar.gz
These values are untrusted, so if any client sends them to us
we must escape them.
Diffstat (limited to 'ext')
-rw-r--r--ext/clogger_ext/clogger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/ext/clogger_ext/clogger.c b/ext/clogger_ext/clogger.c
index c1e3eb4..857ed9a 100644
--- a/ext/clogger_ext/clogger.c
+++ b/ext/clogger_ext/clogger.c
@@ -572,8 +572,7 @@ static void append_cookie(struct clogger *c, VALUE key)
                 cookie = g_dash;
         } else {
                 cookie = rb_hash_aref(c->cookies, key);
-                if (NIL_P(cookie))
-                        cookie = g_dash;
+                cookie = NIL_P(cookie) ? g_dash : byte_xs(cookie);
         }
         rb_str_buf_append(c->log_buf, cookie);
 }