diff options
| author | Susant Palai <spalai@redhat.com> | 2018-11-13 12:13:03 +0530 | 
|---|---|---|
| committer | Amar Tumballi <amarts@redhat.com> | 2018-11-14 18:48:26 +0000 | 
| commit | 4c17065a02fb32acda32aac64da93ea5d326a7d5 (patch) | |
| tree | 27038e49b7d9b23e7f94a100d163bb9ad1534d4a | |
| parent | 3e20df8674d489fba707079e2b5a58347a3b3928 (diff) | |
posix: Fix null pointer dererfence
CID: 1124799 1214618
Change-Id: Iff05180983fe9600be0a2ce015a137e4efb8f533
updates: bz#789278
Signed-off-by: Susant Palai <spalai@redhat.com>
| -rw-r--r-- | xlators/storage/posix/src/posix-aio.c | 6 | ||||
| -rw-r--r-- | xlators/storage/posix/src/posix-inode-fd-ops.c | 7 | 
2 files changed, 13 insertions, 0 deletions
diff --git a/xlators/storage/posix/src/posix-aio.c b/xlators/storage/posix/src/posix-aio.c index cf570d5be41..df32ffdd5c2 100644 --- a/xlators/storage/posix/src/posix-aio.c +++ b/xlators/storage/posix/src/posix-aio.c @@ -266,6 +266,12 @@ posix_aio_writev_complete(struct posix_aio_cb *paiocb, int res, int res2)      struct posix_private *priv = NULL;      fd_t *fd = NULL; +    if (!paiocb) { +        op_ret = -1; +        op_errno = EINVAL; +        goto out; +    } +      frame = paiocb->frame;      this = frame->this;      priv = this->private; diff --git a/xlators/storage/posix/src/posix-inode-fd-ops.c b/xlators/storage/posix/src/posix-inode-fd-ops.c index 2f541ba13b3..8906584684d 100644 --- a/xlators/storage/posix/src/posix-inode-fd-ops.c +++ b/xlators/storage/posix/src/posix-inode-fd-ops.c @@ -2709,6 +2709,13 @@ posix_links_in_same_directory(char *dirpath, int count, inode_t *leaf_inode,                             entry->d_name);              gf_entry = gf_dirent_for_name(entry->d_name); +            if (!gf_entry) { +                gf_msg(this->name, GF_LOG_ERROR, ENOMEM, 0, "gf_entry is NULL"); +                op_ret = -1; +                *op_errno = ENOMEM; +                inode_unref(loc.inode); +                goto out; +            }              gf_entry->inode = inode_ref(leaf_inode);              gf_entry->dict = posix_xattr_fill(this, temppath, &loc, NULL, -1,                                                xdata, NULL);  | 
