-
-
Notifications
You must be signed in to change notification settings - Fork 84
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add lookup_user_record() #1618
add lookup_user_record() #1618
Conversation
More generally I think I disagree with changing The nickname search combination |
The (m, NULL, NULL) is necessary and only used in cases where host is derived from m. If m doesn't exist, m-> doesn't exist. These cases don't have a 'from' or similar variable to pull the host from. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should be u2 = lookup_user_record(NULL, NULL, host);
?
Found by: Mystery-X
Patch by: Geo
It was discovered after the latest rewrite lookup up user records based on account that there are situations where m might not be known, and m being NULL can cause a crash if not properly checked. This creates a wrapper function to a) check which lookup to use based on the provided input, b) fallback to a different lookup in case something returns NULL.
Wrapper function to find an Eggdrop user record based on either a provided
channel memberlist record, host, or account. This function will first check
a provided memberlist and return the result. If no user record is found (or
the memberlist itself was NULL), this function will try again based on a
provided account, and then again on a provided host.
When calling this function it is best to provide all available independent
variables- ie, if you provide 'm' for the memberlist, don't provide
'm->account' for the account, use the independent source variable 'account'
if available. This allows redundant checking in case of unexpected NULLs