17 May
2022
17 May
'22
9:39 a.m.
Huw Davies (@huw) commented about dlls/nsiproxy.sys/ndis.c:
} + + if (!ret) + { + update_if_table(); + while (&entry->entry != &if_list) + { + if (entry->if_luid.Value == luid->Value) + { + *unix_name = entry->if_unix_name; + ret = TRUE; + break; + } + entry = LIST_ENTRY(entry->entry.next, struct if_entry, entry); + } + }
This is pretty fragile and assumes `update_if_table()` appends to the list - simply restart the loop again. Better yet, enclose the first loop in something like this: ```c do {} while(!updated++); ``` -- https://gitlab.winehq.org/wine/wine/-/merge_requests/78#note_935