Skip to content

Fix trivial double-free issue in rdbLoadObject - #3453

Merged
enjoy-binbin merged 1 commit into
valkey-io:unstablefrom
charsyam:feature/fix-double-free-with-zipmap-transform
Apr 9, 2026
Merged

enjoy-binbin merged 1 commit into
valkey-io:unstablefrom
charsyam:feature/fix-double-free-with-zipmap-transform

Conversation

@charsyam

@charsyam charsyam commented Apr 7, 2026

Copy link
Copy Markdown
Contributor

Actually it rarely can happen.

in rdbLoadObject.

when sdstrynewlen is OK and hashtableAdd is OK. but lpSafeToAdd is FAIL.

field will be double-freed.

but lpSafeToAdd will fail len + add > LISTPACK_MAX_SAFETY_SIZE(1GB)

so it can rarely happened and trivial. I think.

@hpatro hpatro changed the title fix trivial double-free issue in rdbLoadObject fix double-free issue in rdbLoadObject Apr 7, 2026
@enjoy-binbin enjoy-binbin changed the title fix double-free issue in rdbLoadObject Fix trivial double-free issue in rdbLoadObject Apr 9, 2026
@enjoy-binbin
enjoy-binbin merged commit be52d8b into valkey-io:unstable Apr 9, 2026
56 of 58 checks passed
sarthakaggarwal97 pushed a commit to sarthakaggarwal97/valkey that referenced this pull request Apr 16, 2026
In rdbLoadObject, when sdstrynewlen is OK and hashtableAdd is OK,
but lpSafeToAdd is FAIL, field will be double-freed.

But lpSafeToAdd will only fail when len + add > LISTPACK_MAX_SAFETY_SIZE(1GB),
so it can rarely happened and trivial.

Signed-off-by: charsyam <[email protected]>
madolson pushed a commit that referenced this pull request Apr 27, 2026
In rdbLoadObject, when sdstrynewlen is OK and hashtableAdd is OK,
but lpSafeToAdd is FAIL, field will be double-freed.

But lpSafeToAdd will only fail when len + add > LISTPACK_MAX_SAFETY_SIZE(1GB),
so it can rarely happened and trivial.

Signed-off-by: charsyam <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants