Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F105519151
D3991.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
D3991.diff
View Options
Index: head/sbin/savecore/savecore.c
===================================================================
--- head/sbin/savecore/savecore.c
+++ head/sbin/savecore/savecore.c
@@ -606,7 +606,8 @@
}
if (kdhl.panicstring[0])
- syslog(LOG_ALERT, "reboot after panic: %s", kdhl.panicstring);
+ syslog(LOG_ALERT, "reboot after panic: %*s",
+ (int)sizeof(kdhl.panicstring), kdhl.panicstring);
else
syslog(LOG_ALERT, "reboot");
@@ -657,7 +658,7 @@
if (info == NULL) {
syslog(LOG_ERR, "fdopen failed: %m");
nerr++;
- goto closefd;
+ goto closeall;
}
xostyle = xo_get_style(NULL);
@@ -665,7 +666,7 @@
if (xoinfo == NULL) {
syslog(LOG_ERR, "%s: %m", infoname);
nerr++;
- goto closefd;
+ goto closeall;
}
xo_open_container_h(xoinfo, "crashdump");
@@ -726,9 +727,8 @@
if (verbose)
printf("clearing dump header\n");
memcpy(kdhl.magic, KERNELDUMPMAGIC_CLEARED, sizeof kdhl.magic);
- lseek(fd, lasthd, SEEK_SET);
- error = write(fd, &kdhl, sizeof kdhl);
- if (error != sizeof kdhl)
+ if (lseek(fd, lasthd, SEEK_SET) != lasthd ||
+ write(fd, &kdhl, sizeof(kdhl)) != sizeof(kdhl))
syslog(LOG_ERR,
"error while clearing the dump header: %m");
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 18, 4:46 AM (12 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
15478730
Default Alt Text
D3991.diff (1 KB)
Attached To
Mode
D3991: Fix various Coverity issues in savecore
Attached
Detach File
Event Timeline
Log In to Comment