Skip to content

Commit 05213cf

Browse files
madolsonPingXie
authored andcommitted
Incorporate Redis CVE for CVE-2025-27151 (valkey-io#2146)
Resolves valkey-io#2145 Incorporate the CVE patch that was sent to us by Redis Ltd. --------- Signed-off-by: Madelyn Olson <[email protected]> Co-authored-by: Ping Xie <[email protected]> (cherry picked from commit 73696bf) Signed-off-by: Viktor Söderqvist <[email protected]>
1 parent 4234a66 commit 05213cf

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/valkey-check-aof.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -556,6 +556,12 @@ int redis_check_aof_main(int argc, char **argv) {
556556
goto invalid_args;
557557
}
558558

559+
/* Check if filepath is longer than PATH_MAX */
560+
if (strnlen(filepath, PATH_MAX + 1) > PATH_MAX) {
561+
printf("Error: filepath is too long (exceeds PATH_MAX)\n");
562+
goto invalid_args;
563+
}
564+
559565
/* In the glibc implementation dirname may modify their argument. */
560566
memcpy(temp_filepath, filepath, strlen(filepath) + 1);
561567
dirpath = dirname(temp_filepath);

0 commit comments

Comments
 (0)