Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bb48c5fa
Commit
bb48c5fa
authored
Oct 20, 2011
by
Nathan Florea
Committed by
antirez
Oct 26, 2011
Browse files
Set errno to 0 before calling strtol.
parent
b508aeb9
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/config.c
View file @
bb48c5fa
...
@@ -74,6 +74,7 @@ void loadServerConfig(char *filename) {
...
@@ -74,6 +74,7 @@ void loadServerConfig(char *filename) {
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"unixsocket"
)
&&
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"unixsocket"
)
&&
argc
==
2
)
{
server
.
unixsocket
=
zstrdup
(
argv
[
1
]);
server
.
unixsocket
=
zstrdup
(
argv
[
1
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"unixsocketperm"
)
&&
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"unixsocketperm"
)
&&
argc
==
2
)
{
errno
=
0
;
server
.
unixsocketperm
=
(
mode_t
)
strtol
(
argv
[
1
],
NULL
,
8
);
server
.
unixsocketperm
=
(
mode_t
)
strtol
(
argv
[
1
],
NULL
,
8
);
if
(
errno
||
server
.
unixsocketperm
>
0777
)
{
if
(
errno
||
server
.
unixsocketperm
>
0777
)
{
err
=
"Invalid socket file permissions"
;
goto
loaderr
;
err
=
"Invalid socket file permissions"
;
goto
loaderr
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment