[lxc/lxc] c85a67: Fix return from fn stack

0 views
Skip to first unread message

Stéphane Graber

unread,
May 9, 2026, 2:21:02 PM (9 days ago) May 9
to lxc-...@lists.linuxcontainers.org
Branch: refs/heads/main
Home: https://github.com/lxc/lxc
Commit: c85a67a616217d121d128ecb8e634d7e25a83219
https://github.com/lxc/lxc/commit/c85a67a616217d121d128ecb8e634d7e25a83219
Author: Serge Hallyn <se...@hallyn.com>
Date: 2026-05-09 (Sat, 09 May 2026)

Changed paths:
M src/lxc/lxccontainer.c
M src/lxc/storage/storage.c
M src/lxc/storage/storage.h

Log Message:
-----------
Fix return from fn stack

storage_copy builds a struct lxc_storage on the stack, and
returns a pointer to that on success to its caller. That's
could be a huge issue, except that its only caller quickly
makes a copy of the -> src and then releases it.

Still, to avoid a future user actually overwriting the struct
and then continuing to use it, let's fix this now. There's
no point returning the whole lxc_storage struct anyway. Just
return a copy of the bdev->src.

Signed-off-by: Serge Hallyn <se...@hallyn.com>


Commit: 10b533a705382552e3f42254224fc9d0c639a0f4
https://github.com/lxc/lxc/commit/10b533a705382552e3f42254224fc9d0c639a0f4
Author: Stéphane Graber <stgr...@stgraber.org>
Date: 2026-05-09 (Sat, 09 May 2026)

Changed paths:
M src/lxc/lxccontainer.c
M src/lxc/storage/storage.c
M src/lxc/storage/storage.h

Log Message:
-----------
Merge pull request #4682 from hallyn/2026-05-09/storagecopy

Fix return from fn stack


Compare: https://github.com/lxc/lxc/compare/8d7a5840f720...10b533a70538

To unsubscribe from these emails, change your notification settings at https://github.com/lxc/lxc/settings/notifications
Reply all
Reply to author
Forward
0 new messages