[meta-efibootguard][PATCH] Update to EBG v0.3

12 views
Skip to first unread message

Jan Kiszka

unread,
May 7, 2018, 7:19:40 AM5/7/18
to efibootguard-dev
From: Jan Kiszka <jan.k...@siemens.com>

Signed-off-by: Jan Kiszka <jan.k...@siemens.com>
---
recipes-bsp/efibootguard/efibootguard.bb | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/recipes-bsp/efibootguard/efibootguard.bb b/recipes-bsp/efibootguard/efibootguard.bb
index 592f5da..3449fda 100644
--- a/recipes-bsp/efibootguard/efibootguard.bb
+++ b/recipes-bsp/efibootguard/efibootguard.bb
@@ -13,8 +13,8 @@ LICENSE = "GPLv2"
LIC_FILES_CHKSUM = "file://COPYING;md5=b234ee4d69f5fce4486a80fdaf4a4263"

SRC_URI = "git://github.com/siemens/efibootguard.git;protocol=https;branch=master"
-SRCREV = "c9b3a5260108706b7d98f4ae91c8463f5356f115"
-PV = "0.2"
+SRCREV = "17534bc4752c3e3408d6facfb819ac8b794b417e"
+PV = "0.3"

S = "${WORKDIR}/git"

--
2.13.6

Andreas J. Reichel

unread,
May 7, 2018, 8:06:15 AM5/7/18
to efibootg...@googlegroups.com, jan.k...@siemens.com, Andreas Reichel
From: Andreas Reichel <andreas.r...@siemens.com>

GCC 8.1 has some additional `intelligent` tests, that do not allow the
length parameter in `strncat` or `strncpy` to be dependent on the
source. Despite the buffer being surely large enough, it complains with

error: 'strncpy' specified bound depends on the length of the
source argument [-Werror=stringop-overflow=].

Fact is, that all the functions that are used like this in the code
behave exactly as their counterpart `strcat` or `strcpy` respectively.
Hence, the solution is to just use strcat and strcpy.

Instead of malloc and strcpy, strdup can be used.

Signed-off-by: Andreas Reichel <andreas.r...@siemens.com>
---
env/env_api_fat.c | 2 +-
env/env_config_file.c | 7 +++----
env/env_disk_utils.c | 6 ++----
env/uservars.c | 2 +-
4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/env/env_api_fat.c b/env/env_api_fat.c
index 1795259..378b20e 100644
--- a/env/env_api_fat.c
+++ b/env/env_api_fat.c
@@ -264,7 +264,7 @@ static int bgenv_get_string(char *buffer, uint64_t *type, void *data,
if (!data) {
return strlen(buffer)+1;
}
- strncpy(data, buffer, strlen(buffer)+1);
+ strcpy(data, buffer);
if (type) {
*type = USERVAR_TYPE_STRING_ASCII;
}
diff --git a/env/env_config_file.c b/env/env_config_file.c
index 7f817cb..873fe10 100644
--- a/env/env_config_file.c
+++ b/env/env_config_file.c
@@ -30,10 +30,9 @@ FILE *open_config_file(CONFIG_PART *cfgpart, char *mode)
if (!configfilepath) {
return NULL;
}
- strncpy(configfilepath, cfgpart->mountpoint,
- strlen(cfgpart->mountpoint) + 1);
- strncat(configfilepath, "/", 1);
- strncat(configfilepath, FAT_ENV_FILENAME, strlen(FAT_ENV_FILENAME));
+ strcpy(configfilepath, cfgpart->mountpoint);
+ strcat(configfilepath, "/");
+ strcat(configfilepath, FAT_ENV_FILENAME);
VERBOSE(stdout, "Probing config file at %s.\n", configfilepath);
FILE *config = fopen(configfilepath, mode);
free(configfilepath);
diff --git a/env/env_disk_utils.c b/env/env_disk_utils.c
index fae3812..9fad94b 100644
--- a/env/env_disk_utils.c
+++ b/env/env_disk_utils.c
@@ -35,12 +35,10 @@ char *get_mountpoint(char *devpath)
(strcmp(part->mnt_fsname, devpath)) == 0) {
char *mntpoint;

- mntpoint = malloc(strlen(part->mnt_dir) + 1);
+ mntpoint = strdup(part->mnt_dir);
if (!mntpoint) {
break;
}
- strncpy(mntpoint, part->mnt_dir,
- strlen(part->mnt_dir) + 1);
return mntpoint;
}
}
@@ -77,7 +75,7 @@ bool mount_partition(CONFIG_PART *cfgpart)
VERBOSE(stderr, "Error, out of memory.\n");
return false;
}
- strncpy(cfgpart->mountpoint, mountpoint, strlen(mountpoint) + 1);
+ strcpy(cfgpart->mountpoint, mountpoint);
return true;
}

diff --git a/env/uservars.c b/env/uservars.c
index aa05235..daa757d 100644
--- a/env/uservars.c
+++ b/env/uservars.c
@@ -78,7 +78,7 @@ void bgenv_serialize_uservar(uint8_t *p, char *key, uint64_t type, void *data,
uint32_t payload_size, data_size;

/* store key */
- strncpy((char *)p, key, strlen(key) + 1);
+ strcpy((char *)p, key);
p += strlen(key) + 1;

/* store payload_size after key */
--
2.17.0

Andreas Reichel

unread,
May 7, 2018, 8:09:53 AM5/7/18
to efibootg...@googlegroups.com, jan.k...@siemens.com
On Mon, May 07, 2018 at 02:01:55PM +0200, Andreas J. Reichel wrote:
Sorry, copied wrong message-id to git send-email.
--
Andreas Reichel
Dipl.-Phys. (Univ.)
Software Consultant

Andreas...@tngtech.com, +49-174-3180074
TNG Technology Consulting GmbH, Betastr. 13a, 85774 Unterfoehring
Geschaeftsfuehrer: Henrik Klagges, Dr. Robert Dahlke, Gerhard Mueller
Sitz: Unterfoehring * Amtsgericht Muenchen * HRB 135082

Jan Kiszka

unread,
May 7, 2018, 8:13:44 AM5/7/18
to Andreas J. Reichel, efibootg...@googlegroups.com
Thanks, applied to next.

Jan

--
Siemens AG, Corporate Technology, CT RDA IOT SES-DE
Corporate Competence Center Embedded Linux
Reply all
Reply to author
Forward
0 new messages