[Bugs] [Bug 1503409] New: Missing null check after `iov_dup` in function `error_gen_writev` of xlators /debug/error-gen/src/error-gen.c

bugzilla at redhat.com bugzilla at redhat.com
Wed Oct 18 04:13:48 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1503409

            Bug ID: 1503409
           Summary: Missing null check after `iov_dup` in function
                    `error_gen_writev` of
                    xlators/debug/error-gen/src/error-gen.c
           Product: GlusterFS
           Version: 3.10
         Component: error-gen
          Severity: low
          Assignee: bugs at gluster.org
          Reporter: alexc at sbrella.com
                CC: bugs at gluster.org



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.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
You are the assignee for the bug.


More information about the Bugs mailing list