Accepting request 1080038 from home:michael-chang:branches:Base:System
- Fix the issue of freeing an uninitialized pointer * 0002-prep_loadenv-Fix-regex-for-Open-Firmware-device-spec.patch OBS-URL: https://build.opensuse.org/request/show/1080038 OBS-URL: https://build.opensuse.org/package/show/Base:System/grub2?expand=0&rev=450
This commit is contained in:
parent
ea9c8438f9
commit
b08e66a989
@ -20,13 +20,14 @@ To fix this issue, we have updated the regular expression to properly
|
|||||||
handle the encoded comma in the Open Firmware device specifier, ensuring
|
handle the encoded comma in the Open Firmware device specifier, ensuring
|
||||||
that the correct boot device is identified and used.
|
that the correct boot device is identified and used.
|
||||||
|
|
||||||
|
v2:
|
||||||
|
Fix the issue of freeing an uninitialized pointer in early_prep_loadenv.
|
||||||
|
|
||||||
Signed-off-by: Michael Chang <mchang@suse.com>
|
Signed-off-by: Michael Chang <mchang@suse.com>
|
||||||
---
|
---
|
||||||
grub-core/commands/prep_loadenv.c | 108 ++++++++++++++++++++++--------
|
grub-core/commands/prep_loadenv.c | 108 ++++++++++++++++++++++--------
|
||||||
1 file changed, 79 insertions(+), 29 deletions(-)
|
1 file changed, 79 insertions(+), 29 deletions(-)
|
||||||
|
|
||||||
diff --git a/grub-core/commands/prep_loadenv.c b/grub-core/commands/prep_loadenv.c
|
|
||||||
index de1b95689..c9797c50a 100644
|
|
||||||
--- a/grub-core/commands/prep_loadenv.c
|
--- a/grub-core/commands/prep_loadenv.c
|
||||||
+++ b/grub-core/commands/prep_loadenv.c
|
+++ b/grub-core/commands/prep_loadenv.c
|
||||||
@@ -15,7 +15,7 @@
|
@@ -15,7 +15,7 @@
|
||||||
@ -38,7 +39,7 @@ index de1b95689..c9797c50a 100644
|
|||||||
{
|
{
|
||||||
if (match->rm_so != -1)
|
if (match->rm_so != -1)
|
||||||
{
|
{
|
||||||
@@ -185,24 +185,18 @@ prep_partname (const char *devname, char **prep)
|
@@ -185,24 +185,18 @@
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -67,7 +68,7 @@ index de1b95689..c9797c50a 100644
|
|||||||
if (ret)
|
if (ret)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
@@ -210,22 +204,11 @@ boot_disk_prep_partname (char **name)
|
@@ -210,22 +204,11 @@
|
||||||
if (! matches)
|
if (! matches)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
||||||
@ -94,7 +95,7 @@ index de1b95689..c9797c50a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
fail:
|
fail:
|
||||||
@@ -235,13 +218,58 @@ boot_disk_prep_partname (char **name)
|
@@ -235,13 +218,60 @@
|
||||||
if (!comperr)
|
if (!comperr)
|
||||||
{
|
{
|
||||||
regfree (®ex);
|
regfree (®ex);
|
||||||
@ -117,6 +118,8 @@ index de1b95689..c9797c50a 100644
|
|||||||
+ grub_size_t nmatch;
|
+ grub_size_t nmatch;
|
||||||
+ char *devname = NULL;
|
+ char *devname = NULL;
|
||||||
+
|
+
|
||||||
|
+ *name = NULL;
|
||||||
|
+
|
||||||
+ if (varname)
|
+ if (varname)
|
||||||
+ cmdpath = grub_env_get (varname);
|
+ cmdpath = grub_env_get (varname);
|
||||||
+ else
|
+ else
|
||||||
@ -155,7 +158,7 @@ index de1b95689..c9797c50a 100644
|
|||||||
}
|
}
|
||||||
|
|
||||||
static grub_err_t
|
static grub_err_t
|
||||||
@@ -274,13 +302,31 @@ grub_cmd_prep_loadenv (grub_command_t cmd __attribute__ ((unused)),
|
@@ -274,13 +304,31 @@
|
||||||
return GRUB_ERR_NONE;
|
return GRUB_ERR_NONE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -181,24 +184,22 @@ index de1b95689..c9797c50a 100644
|
|||||||
early_prep_loadenv (void)
|
early_prep_loadenv (void)
|
||||||
{
|
{
|
||||||
grub_err_t err;
|
grub_err_t err;
|
||||||
char *prep;
|
- char *prep;
|
||||||
|
+ char *prep = NULL;
|
||||||
|
|
||||||
- err = boot_disk_prep_partname (&prep);
|
- err = boot_disk_prep_partname (&prep);
|
||||||
+ err = boot_disk_prep_partname (NULL, &prep);
|
+ err = boot_disk_prep_partname (NULL, &prep);
|
||||||
if (err == GRUB_ERR_NONE && prep)
|
if (err == GRUB_ERR_NONE && prep)
|
||||||
err = prep_read_envblk (prep);
|
err = prep_read_envblk (prep);
|
||||||
if (err == GRUB_ERR_BAD_FILE_TYPE || err == GRUB_ERR_FILE_NOT_FOUND)
|
if (err == GRUB_ERR_BAD_FILE_TYPE || err == GRUB_ERR_FILE_NOT_FOUND)
|
||||||
@@ -295,6 +341,10 @@ static grub_command_t cmd_prep_load;
|
@@ -296,6 +344,10 @@
|
||||||
GRUB_MOD_INIT(prep_loadenv)
|
|
||||||
{
|
{
|
||||||
early_env_hook = early_prep_loadenv;
|
early_env_hook = early_prep_loadenv;
|
||||||
+ cmd_prep_load =
|
cmd_prep_load =
|
||||||
+ grub_register_command("prep_partname", grub_cmd_prep_partname,
|
+ grub_register_command("prep_partname", grub_cmd_prep_partname,
|
||||||
+ "VARNAME",
|
+ "VARNAME",
|
||||||
+ N_("Get partition name of PReP."));
|
+ N_("Get partition name of PReP."));
|
||||||
cmd_prep_load =
|
+ cmd_prep_load =
|
||||||
grub_register_command("prep_load_env", grub_cmd_prep_loadenv,
|
grub_register_command("prep_load_env", grub_cmd_prep_loadenv,
|
||||||
"DEVICE",
|
"DEVICE",
|
||||||
--
|
N_("Load variables from environment block file."));
|
||||||
2.39.2
|
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@ Tue Apr 18 02:42:23 UTC 2023 - Michael Chang <mchang@suse.com>
|
|||||||
- Fix no prep partition error on non-PReP architectures by making the
|
- Fix no prep partition error on non-PReP architectures by making the
|
||||||
prep_loadenv module exclusive to powerpc_ieee1275 platform (bsc#1210489)
|
prep_loadenv module exclusive to powerpc_ieee1275 platform (bsc#1210489)
|
||||||
* 0004-Introduce-prep_load_env-command.patch
|
* 0004-Introduce-prep_load_env-command.patch
|
||||||
|
- Fix the issue of freeing an uninitialized pointer
|
||||||
|
* 0002-prep_loadenv-Fix-regex-for-Open-Firmware-device-spec.patch
|
||||||
- Rediff
|
- Rediff
|
||||||
* 0005-export-environment-at-start-up.patch
|
* 0005-export-environment-at-start-up.patch
|
||||||
* 0009-Add-crypttab_entry-to-obviate-the-need-to-input-pass.patch
|
* 0009-Add-crypttab_entry-to-obviate-the-need-to-input-pass.patch
|
||||||
|
Loading…
Reference in New Issue
Block a user