libcap/0002-psx.c-fix-CVE-2023-260...

26 lines
759 B
Diff

From 5abae730d176107642d5d24cc14f27595ca88a69 Mon Sep 17 00:00:00 2001
From: Carlos Rodriguez-Fernandez <carlosrodrifernandez@gmail.com>
Date: Wed, 22 Nov 2023 07:55:04 -0700
Subject: [PATCH 2/2] psx.c:fix CVE-2023-2602
---
psx/psx.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/psx/psx.c b/psx/psx.c
index 4de3653..eec6db8 100644
--- a/psx/psx.c
+++ b/psx/psx.c
@@ -478,7 +478,7 @@ int __wrap_pthread_create(pthread_t *thread, const pthread_attr_t *attr,
pthread_sigmask(SIG_BLOCK, &sigbit, NULL);
int ret = __real_pthread_create(thread, attr, _psx_start_fn, starter);
- if (ret == -1) {
+ if (ret > 0) {
psx_new_state(_PSX_CREATE, _PSX_IDLE);
memset(starter, 0, sizeof(*starter));
free(starter);
--
2.42.0