mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +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.
|
(as OSX has done) and mark the numbered macros as obsolete.
|
||||||
* Source/NSMessagePort.m:
|
* Source/NSMessagePort.m:
|
||||||
* Source/NSSocketPort.m: Log if we fail to tuirn on keepalive
|
* 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>
|
2018-02-05 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
|
|
|
@ -347,14 +347,18 @@ static char *buildURL(parsedURL *base, parsedURL *rel, BOOL standardize)
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
char *start = base->path;
|
char *start = base->path;
|
||||||
char *end = strrchr(start, '/');
|
|
||||||
|
|
||||||
if (end != 0)
|
if (start != 0)
|
||||||
{
|
{
|
||||||
*tmp++ = '/';
|
char *end = strrchr(start, '/');
|
||||||
memcpy(tmp, start, end - start);
|
|
||||||
tmp += (end - start);
|
if (end != 0)
|
||||||
}
|
{
|
||||||
|
*tmp++ = '/';
|
||||||
|
memcpy(tmp, start, end - start);
|
||||||
|
tmp += (end - start);
|
||||||
|
}
|
||||||
|
}
|
||||||
*tmp++ = '/';
|
*tmp++ = '/';
|
||||||
l = strlen(rpath);
|
l = strlen(rpath);
|
||||||
memcpy(tmp, rpath, l);
|
memcpy(tmp, rpath, l);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue