#94277# In the SubString variant of decode(), avoid calculating illegal pointer values when the SubString is not present.
This commit is contained in:
parent
bd6de2e5c2
commit
904ee450a9
1 changed files with 22 additions and 2 deletions
|
@ -2,9 +2,9 @@
|
|||
*
|
||||
* $RCSfile: urltest.cxx,v $
|
||||
*
|
||||
* $Revision: 1.13 $
|
||||
* $Revision: 1.14 $
|
||||
*
|
||||
* last change: $Author: sb $ $Date: 2002-09-06 14:37:42 $
|
||||
* last change: $Author: sb $ $Date: 2002-10-04 14:08:01 $
|
||||
*
|
||||
* The Contents of this file are made available subject to the terms of
|
||||
* either of the following licenses
|
||||
|
@ -1187,5 +1187,25 @@ main()
|
|||
}
|
||||
}
|
||||
|
||||
if (true)
|
||||
{
|
||||
INetURLObject aUrl;
|
||||
rtl::OUString aUser;
|
||||
aUrl = INetURLObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"ftp://test")));
|
||||
aUser = aUrl.GetUser();
|
||||
if (aUser.getLength() != 0)
|
||||
printf(
|
||||
"BAD <ftp://test> user: \"%s\" != \"\"",
|
||||
rtl::OUStringToOString(aUser, RTL_TEXTENCODING_UTF8).getStr());
|
||||
aUrl = INetURLObject(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
|
||||
"ftp://user@test")));
|
||||
aUser = aUrl.GetUser();
|
||||
if (!aUser.equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("user")))
|
||||
printf(
|
||||
"BAD <ftp://user@test> user: \"%s\" != \"user\"",
|
||||
rtl::OUStringToOString(aUser, RTL_TEXTENCODING_UTF8).getStr());
|
||||
}
|
||||
|
||||
return bSuccess ? EXIT_SUCCESS : EXIT_FAILURE;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue