[PATCH] get_interfaces() return early causes segfault in winbind

David Mulder dmulder at suse.com
Thu Oct 25 15:18:53 UTC 2018

Regression caused by da68a1b2f417ec82ea4ed3e7a4d867cef8ca8f93.

If we return early, be sure to point pifaces to the returned ifaces if
we have 1 return. Otherwise winbind segfaults in load_interfaces() if
there is only 1 interface, because we say there is 1 interface, but
ifaces is NULL (load_interfaces() tries to smb_memdup NULL of iface size 1).

Seen on a machine where dhcp was slow to return, so winbind crashed on
started due to lo being the only interface available on start.

Please review and push if ok!

David Mulder
SUSE Labs Software Engineer - Samba
dmulder at suse.com
SUSE Linux GmbH, GF: Felix Imend├Ârffer, Jane Smithard, Graham Norton, HRB 21284 (AG N├╝rnberg)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-lib-socket-If-returning-early-set-ifaces.patch
Type: text/x-patch
Size: 991 bytes
Desc: not available
URL: <http://lists.samba.org/pipermail/samba-technical/attachments/20181025/2088d0df/0001-lib-socket-If-returning-early-set-ifaces.bin>

More information about the samba-technical mailing list