[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] __acl_create_entry_obj: do not break strict aliasing rules
From: |
Andreas Gruenbacher |
Subject: |
Re: [PATCH] __acl_create_entry_obj: do not break strict aliasing rules |
Date: |
Mon, 31 Aug 2020 18:38:18 +0200 |
Hi Kamil,
that's a nasty bug. Can we clean this up a little more as below?
Thanks,
Andreas
---
libacl/acl_create_entry.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/libacl/acl_create_entry.c b/libacl/acl_create_entry.c
index 4143078..b948d98 100644
--- a/libacl/acl_create_entry.c
+++ b/libacl/acl_create_entry.c
@@ -26,7 +26,7 @@
acl_entry_obj *
__acl_create_entry_obj(acl_obj *acl_obj_p)
{
- acl_entry_obj *entry_obj_p;
+ acl_entry_obj *entry_obj_p, *prev;
if (acl_obj_p->aprealloc == acl_obj_p->aprealloc_end) {
entry_obj_p = new_obj_p(acl_entry);
@@ -39,10 +39,11 @@ __acl_create_entry_obj(acl_obj *acl_obj_p)
acl_obj_p->aused++;
/* Insert at the end of the entry ring */
- entry_obj_p->eprev = acl_obj_p->aprev;
+ prev = acl_obj_p->aprev;
+ entry_obj_p->eprev = prev;
entry_obj_p->enext = (acl_entry_obj *)acl_obj_p;
- entry_obj_p->eprev->enext = entry_obj_p;
- entry_obj_p->enext->eprev = entry_obj_p;
+ prev->enext = entry_obj_p;
+ acl_obj_p->aprev = entry_obj_p;
entry_obj_p->econtainer = acl_obj_p;
init_acl_entry_obj(*entry_obj_p);
--
2.26.2