Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F137079969
D6398.id16420.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D6398.id16420.diff
View Options
Index: head/usr.sbin/rpc.statd/file.c
===================================================================
--- head/usr.sbin/rpc.statd/file.c
+++ head/usr.sbin/rpc.statd/file.c
@@ -82,6 +82,7 @@
struct addrinfo *ai1, *ai2;
int i;
+ ai2 = NULL;
if (getaddrinfo(hostname, NULL, NULL, &ai1) != 0)
ai1 = NULL;
for (i = 0, hp = status_info->hosts; i < status_info->noOfHosts; i++, hp++)
@@ -91,7 +92,7 @@
result = hp;
break;
}
- if (hp->hostname[0] &&
+ if (hp->hostname[0] != '\0' &&
getaddrinfo(hp->hostname, NULL, NULL, &ai2) != 0)
ai2 = NULL;
if (ai1 && ai2)
@@ -113,8 +114,10 @@
if (result)
break;
}
- if (ai2)
+ if (ai2) {
freeaddrinfo(ai2);
+ ai2 = NULL;
+ }
if (!spare_slot && !hp->monList && !hp->notifyReqd)
spare_slot = hp;
}
@@ -134,9 +137,8 @@
if (desired_size > status_file_len)
{
/* Extend file by writing 1 byte of junk at the desired end pos */
- lseek(status_fd, desired_size - 1, SEEK_SET);
- i = write(status_fd, &i, 1);
- if (i < 1)
+ if (lseek(status_fd, desired_size - 1, SEEK_SET) == -1 ||
+ write(status_fd, "\0", 1) < 0)
{
syslog(LOG_ERR, "Unable to extend status file");
return (NULL);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 22, 2:45 AM (3 h, 16 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
25879152
Default Alt Text
D6398.id16420.diff (1 KB)
Attached To
Mode
D6398: Fix verious Coverity CIDS in rpc.lockd find_host()
Attached
Detach File
Event Timeline
Log In to Comment