mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-30 16:30:41 +00:00
fix potential unterminated buffer and leak on failure
This commit is contained in:
parent
b76089f0cd
commit
65ac0eca15
2 changed files with 2 additions and 1 deletions
|
@ -1282,7 +1282,7 @@ typedef struct {
|
|||
memset(&sockAddr, '\0', sizeof(sockAddr));
|
||||
sockAddr.sun_family = AF_LOCAL;
|
||||
strncpy(sockAddr.sun_path, (char*)socketName,
|
||||
sizeof(sockAddr.sun_path));
|
||||
sizeof(sockAddr.sun_path) - 1);
|
||||
if ((desc = socket(PF_LOCAL, SOCK_STREAM, PF_UNSPEC)) < 0)
|
||||
{
|
||||
NSLog(@"unable to create socket - %@", [NSError _last]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue