Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F178133757
D8162.1796070477.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None
D8162.1796070477.diff
View Options
Index: sbin/savecore/savecore.c
===================================================================
--- sbin/savecore/savecore.c
+++ sbin/savecore/savecore.c
@@ -436,7 +436,8 @@
{
xo_handle_t *xostdout, *xoinfo;
static char infoname[PATH_MAX], corename[PATH_MAX], linkname[PATH_MAX];
- static char *buf = NULL, *temp = NULL;
+ static char *buf = NULL;
+ char *temp = NULL;
struct kerneldumpheader kdhf, kdhl;
off_t mediasize, dumpsize, firsthd, lasthd;
FILE *info, *fp;
@@ -498,12 +499,10 @@
}
lasthd = mediasize - sectorsize;
+ temp = malloc(sectorsize);
if (temp == NULL) {
- temp = malloc(sectorsize);
- if (temp == NULL) {
- syslog(LOG_ERR, "%m");
- goto closefd;
- }
+ syslog(LOG_ERR, "%m");
+ goto closefd;
}
if (lseek(fd, lasthd, SEEK_SET) != lasthd ||
read(fd, temp, sectorsize) != (ssize_t)sectorsize) {
@@ -749,6 +748,7 @@
}
xo_close_container_h(xostdout, "crashdump");
xo_finish_h(xostdout);
+ free(temp);
close(fd);
return;
@@ -756,6 +756,7 @@
fclose(fp);
closefd:
+ free(temp);
close(fd);
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Nov 30, 8:27 PM (17 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
42111818
Default Alt Text
D8162.1796070477.diff (1 KB)
Attached To
Mode
D8162: savecore(8): Fix buffer overrun inspecting disks with varying sector size
Attached
Detach File
Event Timeline