projects
/
redis.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
465b418
)
check return value of getcwd()
author
antirez
<antirez@gmail.com>
Mon, 21 Feb 2011 16:41:25 +0000
(17:41 +0100)
committer
antirez
<antirez@gmail.com>
Mon, 21 Feb 2011 16:51:28 +0000
(17:51 +0100)
src/config.c
patch
|
blob
|
blame
|
history
diff --git
a/src/config.c
b/src/config.c
index ea2dba15099db25dec1104337b79956ad1d56dec..632a739890c2992c86f9342fd681fd987ed4680e 100644
(file)
--- a/
src/config.c
+++ b/
src/config.c
@@
-468,10
+468,12
@@
void configGetCommand(redisClient *c) {
if (stringmatch(pattern,"dir",0)) {
char buf[1024];
- buf[0] = '\0';
- getcwd(buf,sizeof(buf));
addReplyBulkCString(c,"dir");
- addReplyBulkCString(c,buf);
+ if (getcwd(buf,sizeof(buf)) == NULL) {
+ buf[0] = '\0';
+ } else {
+ addReplyBulkCString(c,buf);
+ }
matches++;
}
if (stringmatch(pattern,"dbfilename",0)) {