Bug 1503409 - Missing null check after `iov_dup` in function `error_gen_writev` of xlators/debug/error-gen/src/error-gen.c
Summary: Missing null check after `iov_dup` in function `error_gen_writev` of xlators/...
Keywords:
Status: CLOSED EOL
Alias: None
Product: GlusterFS
Classification: Community
Component: error-gen
Version: 3.10
Hardware: All
OS: All
unspecified
low
Target Milestone: ---
Assignee: bugs@gluster.org
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2017-10-18 04:13 UTC by Alex CHEN
Modified: 2018-06-20 18:29 UTC (History)
1 user (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2018-06-20 18:29:50 UTC
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Embargoed:


Attachments (Terms of Use)

Description Alex CHEN 2017-10-18 04:13:48 UTC
Description of problem:


Our code scanner has reported a potential null pointer dereference, in function `error_gen_writev` of xlators/debug/error-gen/src/error-gen.c:

		shortvec = iov_dup(vector, 1);
		shortvec->iov_len /= 2;   // <== use of potential NULL


There are null checks after `iov_dup` in other places, so I thought the programmer had forgotten to add one in above:
https://github.com/gluster/glusterfs/blob/3dce15e10c263e8e071b26046568e0a171a3153d/xlators/cluster/ec/src/ec-inode-read.c#L1292-L1293
https://github.com/gluster/glusterfs/blob/3dce15e10c263e8e071b26046568e0a171a3153d/xlators/cluster/ec/src/ec-inode-read.c#L1226-L1227

Regards,
Alex, SourceBrella Inc.

Comment 1 Alex CHEN 2017-10-27 08:13:43 UTC
could anyone take a quick look and see if it needs a fix?

Comment 2 Shyamsundar 2018-06-20 18:29:50 UTC
This bug reported is against a version of Gluster that is no longer maintained
(or has been EOL'd). See https://www.gluster.org/release-schedule/ for the
versions currently maintained.

As a result this bug is being closed.

If the bug persists on a maintained version of gluster or against the mainline
gluster repository, request that it be reopened and the Version field be marked
appropriately.


Note You need to log in before you can comment on or make changes to this bug.