Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
9de07558
Commit
9de07558
authored
Mar 14, 2014
by
Matt Stancliff
Committed by
antirez
Mar 14, 2014
Browse files
Fix segfault from accessing array out of bounds
argc == 2; argv[2] == crash
parent
a31a0b43
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/sentinel.c
View file @
9de07558
...
@@ -1346,7 +1346,7 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
...
@@ -1346,7 +1346,7 @@ char *sentinelHandleConfiguration(char **argv, int argc) {
ri
->
auth_pass
=
sdsnew
(
argv
[
2
]);
ri
->
auth_pass
=
sdsnew
(
argv
[
2
]);
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"current-epoch"
)
&&
argc
==
2
)
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"current-epoch"
)
&&
argc
==
2
)
{
/* current-epoch <epoch> */
/* current-epoch <epoch> */
unsigned
long
long
current_epoch
=
strtoull
(
argv
[
2
],
NULL
,
10
);
unsigned
long
long
current_epoch
=
strtoull
(
argv
[
1
],
NULL
,
10
);
if
(
current_epoch
>
sentinel
.
current_epoch
)
if
(
current_epoch
>
sentinel
.
current_epoch
)
sentinel
.
current_epoch
=
current_epoch
;
sentinel
.
current_epoch
=
current_epoch
;
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"config-epoch"
)
&&
argc
==
3
)
{
}
else
if
(
!
strcasecmp
(
argv
[
0
],
"config-epoch"
)
&&
argc
==
3
)
{
...
...
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