comparison libpurple/util.c @ 18600:321658bf0e03

Valgrind was showing "Invalid read of size 1" when a string is passed to this function that doesn't have an @ in it. I think this bug exists in the O'Reilly version, too
author Mark Doliner <mark@kingant.net>
date Sun, 22 Jul 2007 06:53:13 +0000
parents 481eb37730bf
children 450090c68351
comparison
equal deleted inserted replaced
18599:4efd240ffaa0 18600:321658bf0e03
3992 } 3992 }
3993 if (*c == '@') break; 3993 if (*c == '@') break;
3994 if (*c <= ' ' || *c >= 127) return FALSE; 3994 if (*c <= ' ' || *c >= 127) return FALSE;
3995 if (strchr(rfc822_specials, *c)) return FALSE; 3995 if (strchr(rfc822_specials, *c)) return FALSE;
3996 } 3996 }
3997
3998 /* It's obviously not an email address if we didn't find an '@' above */
3999 if (*c == '\0') return FALSE;
4000
3997 /* strictly we should return false if (*(c - 1) == '.') too, but I think 4001 /* strictly we should return false if (*(c - 1) == '.') too, but I think
3998 * we should permit user.@domain type addresses - they do work :) */ 4002 * we should permit user.@domain type addresses - they do work :) */
3999 if (c == address) return FALSE; 4003 if (c == address) return FALSE;
4000 4004
4001 /* next we validate the domain portion (name@domain) (rfc1035 & rfc1011) */ 4005 /* next we validate the domain portion (name@domain) (rfc1035 & rfc1011) */