From 901ceab20b9a39cb2196f5404f5b89a2af328ef8 Mon Sep 17 00:00:00 2001 From: antirez Date: Wed, 15 May 2013 11:15:18 +0200 Subject: [PATCH] CONFIG REWRITE: correctly escape the notify-keyspace-events option. --- src/config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/config.c b/src/config.c index a9fd392cc3..e3cb80118b 100644 --- a/src/config.c +++ b/src/config.c @@ -1358,7 +1358,9 @@ void rewriteConfigNotifykeyspaceeventsOption(struct rewriteConfigState *state) { sds line, flags; flags = keyspaceEventsFlagsToString(server.notify_keyspace_events); - line = sdscatprintf(sdsempty(),"%s %s", option, flags); + line = sdsnew(option); + line = sdscatlen(line, " ", 1); + line = sdscatrepr(line, flags, sdslen(flags)); sdsfree(flags); rewriteConfigRewriteLine(state,option,line,force); }