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
209f3a1e
Commit
209f3a1e
authored
Apr 02, 2020
by
Xudong Zhang
Committed by
antirez
Apr 07, 2020
Browse files
fix integer overflow
parent
024c380b
Changes
1
Show whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
209f3a1e
...
@@ -110,7 +110,7 @@ quicklist *quicklistCreate(void) {
...
@@ -110,7 +110,7 @@ quicklist *quicklistCreate(void) {
return
quicklist
;
return
quicklist
;
}
}
#define COMPRESS_MAX (1 << QL_COMP_BITS)
#define COMPRESS_MAX
(
(1 << QL_COMP_BITS)
-1)
void
quicklistSetCompressDepth
(
quicklist
*
quicklist
,
int
compress
)
{
void
quicklistSetCompressDepth
(
quicklist
*
quicklist
,
int
compress
)
{
if
(
compress
>
COMPRESS_MAX
)
{
if
(
compress
>
COMPRESS_MAX
)
{
compress
=
COMPRESS_MAX
;
compress
=
COMPRESS_MAX
;
...
@@ -120,7 +120,7 @@ void quicklistSetCompressDepth(quicklist *quicklist, int compress) {
...
@@ -120,7 +120,7 @@ void quicklistSetCompressDepth(quicklist *quicklist, int compress) {
quicklist
->
compress
=
compress
;
quicklist
->
compress
=
compress
;
}
}
#define FILL_MAX (1 << (QL_FILL_BITS-1))
#define FILL_MAX
(
(1 << (QL_FILL_BITS-1))
-1)
void
quicklistSetFill
(
quicklist
*
quicklist
,
int
fill
)
{
void
quicklistSetFill
(
quicklist
*
quicklist
,
int
fill
)
{
if
(
fill
>
FILL_MAX
)
{
if
(
fill
>
FILL_MAX
)
{
fill
=
FILL_MAX
;
fill
=
FILL_MAX
;
...
...
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