--- src/LYUtils.c.old 2005-06-03 00:36:59.000000000 +0200 +++ src/LYUtils.c 2005-09-25 00:53:39.621036536 +0200 @@ -4368,6 +4368,7 @@ BOOLEAN LYExpandHostForURL(char **Alloca char DomainPrefix[80]; const char *StartP, *EndP; char DomainSuffix[80]; + unsigned int fixcount; const char *StartS, *EndS; char *Str = NULL, *StrColon = NULL, *MsgStr = NULL; char *Host = NULL, *HostColon = NULL, *host = NULL; @@ -4521,7 +4522,10 @@ BOOLEAN LYExpandHostForURL(char **Alloca while (*EndP && !WHITE(*EndP) && *EndP != ',') { EndP++; /* Find separator */ } - LYstrncpy(DomainPrefix, StartP, (EndP - StartP)); + fixcount = EndP - StartP; + if (fixcount > 79) + fixcount = 79; + LYstrncpy(DomainPrefix, StartP, fixcount); /* * Test each prefix with each suffix. - FM @@ -4541,7 +4545,10 @@ BOOLEAN LYExpandHostForURL(char **Alloca while (*EndS && !WHITE(*EndS) && *EndS != ',') { EndS++; /* Find separator */ } - LYstrncpy(DomainSuffix, StartS, (EndS - StartS)); + fixcount = EndS - StartS; + if (fixcount > 79) + fixcount = 79; + LYstrncpy(DomainSuffix, StartS, fixcount); /* * Create domain names and do DNS tests. - FM @@ -4597,7 +4604,10 @@ BOOLEAN LYExpandHostForURL(char **Alloca while (*EndS && !WHITE(*EndS) && *EndS != ',') { EndS++; /* Find separator */ } - LYstrncpy(DomainSuffix, StartS, (EndS - StartS)); + fixcount = EndS - StartS; + if (fixcount > 79) + fixcount = 79; + LYstrncpy(DomainSuffix, StartS, fixcount); } } while ((GotHost == FALSE) && (*DomainSuffix != '\0')); @@ -4613,7 +4623,10 @@ BOOLEAN LYExpandHostForURL(char **Alloca while (*EndP && !WHITE(*EndP) && *EndP != ',') { EndP++; /* Find separator */ } - LYstrncpy(DomainPrefix, StartP, (EndP - StartP)); + fixcount = EndP - StartP; + if (fixcount > 79) + fixcount = 79; + LYstrncpy(DomainPrefix, StartP, fixcount); } } while ((GotHost == FALSE) && (*DomainPrefix != '\0'));