Skip to content

Commit 99b437a

Browse files
error27torvalds
authored andcommitted
AFS: Potential null dereference
It seems clear from the surrounding code that xpermits is allowed to be NULL here. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 45575f5 commit 99b437a

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

‎fs/afs/security.c‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,9 @@ void afs_cache_permit(struct afs_vnode *vnode, struct key *key, long acl_order)
189189
if (!permits)
190190
goto out_unlock;
191191

192-
memcpy(permits->permits, xpermits->permits,
193-
count * sizeof(struct afs_permit));
192+
if (xpermits)
193+
memcpy(permits->permits, xpermits->permits,
194+
count * sizeof(struct afs_permit));
194195

195196
_debug("key %x access %x",
196197
key_serial(key), vnode->status.caller_access);

0 commit comments

Comments
 (0)