mirror of
https://github.com/samba-team/samba.git
synced 2025-03-30 06:50:24 +03:00
Return NULL if tevent_add_fd() is passed a negative fd
Autobuild-User: Simo Sorce <idra@samba.org> Autobuild-Date: Mon Feb 14 17:47:03 CET 2011 on sn-devel-104
This commit is contained in:
parent
b423d83729
commit
d6a41c2723
@ -51,6 +51,12 @@ struct tevent_fd *tevent_common_add_fd(struct tevent_context *ev, TALLOC_CTX *me
|
||||
{
|
||||
struct tevent_fd *fde;
|
||||
|
||||
/* tevent will crash later on select() if we save
|
||||
* a negative file descriptor. Better to fail here
|
||||
* so that consumers will be able to debug it
|
||||
*/
|
||||
if (fd < 0) return NULL;
|
||||
|
||||
fde = talloc(mem_ctx?mem_ctx:ev, struct tevent_fd);
|
||||
if (!fde) return NULL;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user