mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 12:43:29 +02:00
selinux: keep context struct members in sync
Commit53f3517ae0
("selinux: do not leave dangling pointer behind") reset the `str` field of the `context` struct in an OOM error branch. In this struct the fields `str` and `len` are coupled and should be kept in sync. Set the length to zero according to the string be set to NULL. Fixes:53f3517ae0
("selinux: do not leave dangling pointer behind") Signed-off-by: Christian Göttsche <cgzones@googlemail.com> Signed-off-by: Paul Moore <paul@paul-moore.com>
This commit is contained in:
committed by
Paul Moore
parent
85c3222ddd
commit
ed99135f76
@@ -168,6 +168,7 @@ static inline int context_cpy(struct context *dst, const struct context *src)
|
|||||||
if (rc) {
|
if (rc) {
|
||||||
kfree(dst->str);
|
kfree(dst->str);
|
||||||
dst->str = NULL;
|
dst->str = NULL;
|
||||||
|
dst->len = 0;
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user