Mercurial > pidgin
comparison plugins/log_reader.c @ 13493:e8b0a9376481
[gaim-migrate @ 15869]
Resolves CID 97
'Variable "to_name" tracked as NULL was dereferenced.'
I also applied the same change to the from_name code.
committer: Tailor Script <tailor@pidgin.im>
| author | Richard Laager <rlaager@wiktel.com> |
|---|---|
| date | Mon, 13 Mar 2006 17:57:34 +0000 |
| parents | 0dbab0e08f2a |
| children | 2f0d4179ec05 |
comparison
equal
deleted
inserted
replaced
| 13492:59ea9ddd408b | 13493:e8b0a9376481 |
|---|---|
| 854 /* Try to guess which user is me. | 854 /* Try to guess which user is me. |
| 855 * The first step is to determine if either of the names matches either my | 855 * The first step is to determine if either of the names matches either my |
| 856 * friendly name or alias. For this test, "match" is defined as: | 856 * friendly name or alias. For this test, "match" is defined as: |
| 857 * ^(friendly_name|alias)([^a-zA-Z0-9].*)?$ | 857 * ^(friendly_name|alias)([^a-zA-Z0-9].*)?$ |
| 858 */ | 858 */ |
| 859 from_name_matches = ((g_str_has_prefix( | 859 from_name_matches = from_name != NULL && ( |
| 860 from_name, friendly_name) && | 860 (g_str_has_prefix(from_name, friendly_name) && |
| 861 !isalnum(*(from_name + friendly_name_length))) || | 861 !isalnum(*(from_name + friendly_name_length))) || |
| 862 (g_str_has_prefix(from_name, log->account->alias) && | 862 (g_str_has_prefix(from_name, log->account->alias) && |
| 863 !isalnum(*(from_name + alias_length)))); | 863 !isalnum(*(from_name + alias_length)))); |
| 864 | 864 |
| 865 to_name_matches = ((g_str_has_prefix( | 865 to_name_matches = to_name != NULL && ( |
| 866 to_name, friendly_name) && | 866 (gaim_str_has_prefix(to_name, friendly_name) && |
| 867 !isalnum(*(to_name + friendly_name_length))) || | 867 !isalnum(*(to_name + friendly_name_length))) || |
| 868 (g_str_has_prefix(to_name, log->account->alias) && | 868 (gaim_str_has_prefix(to_name, log->account->alias) && |
| 869 !isalnum(*(to_name + alias_length)))); | 869 !isalnum(*(to_name + alias_length)))); |
| 870 | 870 |
| 871 if (from_name_matches) { | 871 if (from_name_matches) { |
| 872 if (!to_name_matches) { | 872 if (!to_name_matches) { |
| 873 name_guessed = NAME_GUESS_ME; | 873 name_guessed = NAME_GUESS_ME; |
| 874 } | 874 } |
