Rémi Bernon (@rbernon) commented about dlls/winewayland.drv/wayland_data_device.c:
- new_mime_type = malloc(new_mime_len + 1);
- if (!new_mime_type) return NULL;
- for (cur_read = mime_type, cur_write = new_mime_type; *cur_read != '\0'; ++cur_read)
- {
if (*cur_read != ' ' && *cur_read != '"')
*cur_write++ = tolower(*cur_read);
- }
- *cur_write = '\0';
- return new_mime_type;
+}
+static int poll_until(int fd, int events, ULONG end_time)
I think the non-blocking read/writes makes the code much more complicated than it could be, and I'm really not sure we need to guard against this kind of problems. If other clients are bogus they need to be fixed. If every client guards against other clients bugs, the issues might very well stay undetected for a longer time, up to a point where unfixable applications are widespread (proprietary, etc), and making the protection *necessary* when it wouldn't have been in the first place.