diff options
| author | Daniel Golle | 2021-08-30 23:39:12 +0000 |
|---|---|---|
| committer | Daniel Golle | 2021-08-30 23:46:54 +0000 |
| commit | f5fe04b93a2131bd57f34f4d526e57933caa8a4c (patch) | |
| tree | 47f7f00b9efa8c5b073766c880f2a6de7376c238 | |
| parent | 86f82f3de1da07ef86a33a8e9302c98dafbfa6ec (diff) | |
| download | procd-f5fe04b93a2131bd57f34f4d526e57933caa8a4c.tar.gz | |
jail: actually check calloc return value
Instead of checking the return value of calloc(), the check intended
for that would rather check if the pointer passed as an argument.
As that doesn't make much sense, rather actually check calloc()
return value.
Coverity CID: 1490071 Dereference before null check
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
| -rw-r--r-- | jail/fs.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -357,7 +357,7 @@ static int parseOCImountopts(struct blob_attr *msg, unsigned long *mount_flags, if (len) { *mount_data = calloc(len + 1, sizeof(char)); - if (!mount_data) + if (!(*mount_data)) return ENOMEM; len = 0; |