diff options
Diffstat (limited to 'meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch')
-rw-r--r-- | meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch new file mode 100644 index 000000000..cad695154 --- /dev/null +++ b/meta-initramfs/recipes-kernel/kexec/kexec-tools-klibc-2.0.2/x86_vfscanf.patch | |||
@@ -0,0 +1,27 @@ | |||
1 | --- a/kexec/arch/i386/x86-linux-setup.c | ||
2 | +++ b/kexec/arch/i386/x86-linux-setup.c | ||
3 | @@ -176,6 +176,8 @@ static int file_scanf(const char *dir, c | ||
4 | FILE *fp; | ||
5 | int retno; | ||
6 | char filename[PATH_MAX]; | ||
7 | + long line_size = MAX_LINE; | ||
8 | + char *line; | ||
9 | |||
10 | snprintf(filename, PATH_MAX, "%s/%s", dir, file); | ||
11 | filename[PATH_MAX-1] = 0; | ||
12 | @@ -186,7 +188,14 @@ static int file_scanf(const char *dir, c | ||
13 | } | ||
14 | |||
15 | va_start(argptr, scanf_line); | ||
16 | - retno = vfscanf(fp, scanf_line, argptr); | ||
17 | + | ||
18 | + line = xmalloc(sizeof(line) * line_size); | ||
19 | + while(fgets(line, sizeof(line), fp) != NULL ) { | ||
20 | + line_size += MAX_LINE; | ||
21 | + line = xrealloc(line,line_size); | ||
22 | + } | ||
23 | + retno = vsscanf(line, scanf_line, argptr); | ||
24 | + | ||
25 | va_end(argptr); | ||
26 | |||
27 | fclose(fp); | ||