GNOME Bugzilla – Bug 710002
G_MAXUINT may be assigned as duplicate source id
Last modified: 2013-10-13 14:26:47 UTC
Created attachment 257113 [details] [review] Patch to add id to used_source_ids When the source id overflows, source id assigning switches from a standard increment to randomly assigned, with a check to ensure the random source id is not currently in use. The source which triggers the overflow is assigned G_MAXUINT, but not until after the assigned source ids are cached. This leads to the remote possibility that a second source can be assigned G_MAXUINT as its source id while the original source is still active.
Review of attachment 257113 [details] [review]: Hi Noah, Thank you very much, this patch looks correct to me. Out of curiosity did you hit this in practice or did you just notice this via code inspection? You seem to have submitted a patch without an email address; did you have a concern about your email appearing in the git log? Or is it OK if I apply this patch and credit you?
Colin, I just noticed it in code. I was checking to see if I wanted to hold the id or source ref on a local timeout source. The patch got created with a different email account, so I just removed it. I'm fine with being credited. :) Best, Noah