mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-29 16:01:38 +00:00
fix possible nul pointer deref
This commit is contained in:
parent
3d98433cc7
commit
f7c71c695e
2 changed files with 12 additions and 7 deletions
|
@ -7,6 +7,7 @@
|
|||
(as OSX has done) and mark the numbered macros as obsolete.
|
||||
* Source/NSMessagePort.m:
|
||||
* Source/NSSocketPort.m: Log if we fail to tuirn on keepalive
|
||||
* Source/NSURL.m: fix possible nul pointer dereference
|
||||
|
||||
2018-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||
|
||||
|
|
|
@ -347,14 +347,18 @@ static char *buildURL(parsedURL *base, parsedURL *rel, BOOL standardize)
|
|||
else
|
||||
{
|
||||
char *start = base->path;
|
||||
char *end = strrchr(start, '/');
|
||||
|
||||
if (end != 0)
|
||||
{
|
||||
*tmp++ = '/';
|
||||
memcpy(tmp, start, end - start);
|
||||
tmp += (end - start);
|
||||
}
|
||||
if (start != 0)
|
||||
{
|
||||
char *end = strrchr(start, '/');
|
||||
|
||||
if (end != 0)
|
||||
{
|
||||
*tmp++ = '/';
|
||||
memcpy(tmp, start, end - start);
|
||||
tmp += (end - start);
|
||||
}
|
||||
}
|
||||
*tmp++ = '/';
|
||||
l = strlen(rpath);
|
||||
memcpy(tmp, rpath, l);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue