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
4e8e7fb0
Unverified
Commit
4e8e7fb0
authored
Apr 03, 2020
by
Salvatore Sanfilippo
Committed by
GitHub
Apr 03, 2020
Browse files
Merge pull request #7055 from zxdvd/patch-1
fix integer overflow
parents
5b73ea3c
78df0165
Changes
1
Show whitespace changes
Inline
Side-by-side
src/quicklist.c
View file @
4e8e7fb0
...
@@ -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