Bug 7955 - tevent_add_fd() should fail when passed a negative fd
Summary: tevent_add_fd() should fail when passed a negative fd
Status: RESOLVED FIXED
Alias: None
Product: Samba 3.6
Classification: Unclassified
Component: Clustering (show other bugs)
Version: unspecified
Hardware: All Linux
: P3 normal
Target Milestone: ---
Assignee: Volker Lendecke
QA Contact: Samba QA Contact
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-14 09:21 UTC by Stephen Gallagher
Modified: 2022-08-19 22:48 UTC (History)
1 user (show)

See Also:


Attachments
Patch to return NULL on negative file descriptor (946 bytes, patch)
2011-02-14 09:31 UTC, Stephen Gallagher
idra: review+
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Gallagher 2011-02-14 09:21:42 UTC
Currently, tevent_add_fd() will accept a negative fd (e.g. -1). It will then fail later when select() is called on that file descriptor. (Making it difficult to track down where the faulty tevent_add_fd() was called.

tevent_add_fd() should fail and return NULL if the file descriptor is negative

Bug was noted on libtevent 0.9.8 and 0.9.10.
Comment 1 Stephen Gallagher 2011-02-14 09:31:23 UTC
Created attachment 6246 [details]
Patch to return NULL on negative file descriptor
Comment 2 Jo Sutton 2022-08-19 22:48:25 UTC
Fixed in master with d6a41c2723cda59b3cd6ae9a1e77b62f25067663.