Closed Bug 1278504 Opened 4 years ago Closed 4 years ago

[Static Analysis][Buffer not null terminated] In function ListInterfaceAddresses

Categories

(Core :: Networking, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla50
Tracking Status
firefox50 --- fixed

People

(Reporter: andi, Assigned: andi)

References

(Blocks 1 open bug)

Details

(Keywords: coverity, Whiteboard: CID 1362514)

Attachments

(1 file)

The Static Analysis tool Coverity detected that a buffer not null terminated issue can happen in the following context:

>>    struct ifreq ifreq;
>>    memset(&ifreq, 0, sizeof(struct ifreq));   	
>>    strncpy(ifreq.ifr_name, aInterface, IFNAMSIZ);

The issue was triggered on strncpy call because IFNAMSIZ is the same value as the size of ifreq.ifr_name -> 16 bytes.
Comment on attachment 8760679 [details]
Bug 1278504 - fixed buffer not null terminated.

Review request updated; see interdiff: https://reviewboard.mozilla.org/r/58188/diff/1-2/
Comment on attachment 8760679 [details]
Bug 1278504 - fixed buffer not null terminated.

https://reviewboard.mozilla.org/r/58188/#review55060

Thanks!
Attachment #8760679 - Flags: review?(valentin.gosu) → review+
https://hg.mozilla.org/mozilla-central/rev/be7175764dc7
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla50
You need to log in before you can comment on or make changes to this bug.