diff options
| author | Khem Raj <raj.khem@gmail.com> | 2018-05-09 12:00:11 -0700 |
|---|---|---|
| committer | Armin Kuster <akuster808@gmail.com> | 2018-05-17 08:23:22 -0700 |
| commit | a2b026529c6443056acf3cbf6231c202b349603f (patch) | |
| tree | aa60ec3a508771f44b04d6ac192a31493b8faa85 | |
| parent | a0d4053fc3c259a19e5d99d734e5c7779519a412 (diff) | |
| download | meta-openembedded-a2b026529c6443056acf3cbf6231c202b349603f.tar.gz | |
upm: Fix build with gcc8
Signed-off-by: Khem Raj <raj.khem@gmail.com>
Signed-off-by: Armin Kuster <akuster808@gmail.com>
| -rw-r--r-- | meta-oe/recipes-extended/upm/upm/0001-Replace-strncpy-with-memcpy.patch | 49 | ||||
| -rw-r--r-- | meta-oe/recipes-extended/upm/upm_git.bb | 3 |
2 files changed, 51 insertions, 1 deletions
diff --git a/meta-oe/recipes-extended/upm/upm/0001-Replace-strncpy-with-memcpy.patch b/meta-oe/recipes-extended/upm/upm/0001-Replace-strncpy-with-memcpy.patch new file mode 100644 index 0000000000..4b17087ef8 --- /dev/null +++ b/meta-oe/recipes-extended/upm/upm/0001-Replace-strncpy-with-memcpy.patch | |||
| @@ -0,0 +1,49 @@ | |||
| 1 | From d314f26e024aaf15bf4ab22ceb98501148d0eac8 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <raj.khem@gmail.com> | ||
| 3 | Date: Mon, 7 May 2018 19:53:33 -0700 | ||
| 4 | Subject: [PATCH] Replace strncpy with memcpy | ||
| 5 | |||
| 6 | gcc8 detects that strncpy is overwiritng the null terminating character | ||
| 7 | the source strings are already initialized to 0 so memcpy would do the same | ||
| 8 | job | ||
| 9 | |||
| 10 | Fixes | ||
| 11 | rn2903.c:153:5: error: 'strncpy' output may be truncated copying 16 bytes from a string of length 511 [-Werror=stringop-truncation] | ||
| 12 | strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64); | ||
| 13 | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
| 14 | |||
| 15 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
| 16 | --- | ||
| 17 | src/ecezo/ecezo.c | 2 +- | ||
| 18 | src/rn2903/rn2903.c | 2 +- | ||
| 19 | 2 files changed, 2 insertions(+), 2 deletions(-) | ||
| 20 | |||
| 21 | diff --git a/src/ecezo/ecezo.c b/src/ecezo/ecezo.c | ||
| 22 | index 6a195fc1..56c6dab3 100644 | ||
| 23 | --- a/src/ecezo/ecezo.c | ||
| 24 | +++ b/src/ecezo/ecezo.c | ||
| 25 | @@ -488,7 +488,7 @@ int ecezo_send_command(const ecezo_context dev, char *cmd, char *buffer, | ||
| 26 | // our write buffer | ||
| 27 | char writeBuffer[ECEZO_MAX_BUFFER_LEN]; | ||
| 28 | |||
| 29 | - strncpy(writeBuffer, cmd, ECEZO_MAX_BUFFER_LEN); | ||
| 30 | + memcpy(writeBuffer, cmd, ECEZO_MAX_BUFFER_LEN-1); | ||
| 31 | writeBuffer[ECEZO_MAX_BUFFER_LEN - 1] = 0; | ||
| 32 | |||
| 33 | int writelen = strlen(writeBuffer); | ||
| 34 | diff --git a/src/rn2903/rn2903.c b/src/rn2903/rn2903.c | ||
| 35 | index f30a33ae..01a011da 100644 | ||
| 36 | --- a/src/rn2903/rn2903.c | ||
| 37 | +++ b/src/rn2903/rn2903.c | ||
| 38 | @@ -150,7 +150,7 @@ static rn2903_context _rn2903_postinit(rn2903_context dev, | ||
| 39 | rn2903_close(dev); | ||
| 40 | return NULL; | ||
| 41 | } | ||
| 42 | - strncpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64); | ||
| 43 | + memcpy(dev->hardware_eui, dev->resp_data, RN2903_MAX_HEX_EUI64); | ||
| 44 | |||
| 45 | return dev; | ||
| 46 | } | ||
| 47 | -- | ||
| 48 | 2.17.0 | ||
| 49 | |||
diff --git a/meta-oe/recipes-extended/upm/upm_git.bb b/meta-oe/recipes-extended/upm/upm_git.bb index d742a5e461..478aa0db1d 100644 --- a/meta-oe/recipes-extended/upm/upm_git.bb +++ b/meta-oe/recipes-extended/upm/upm_git.bb | |||
| @@ -7,11 +7,12 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=66493d54e65bfc12c7983ff2e884f37f" | |||
| 7 | 7 | ||
| 8 | DEPENDS = "libjpeg-turbo mraa" | 8 | DEPENDS = "libjpeg-turbo mraa" |
| 9 | 9 | ||
| 10 | SRCREV = "cc7fec9ae0228add9011bf1c2cd5e0ca2ba0d4f0" | 10 | SRCREV = "37642f3b0194f6ddd63f1e6b5d49b8cb689d5c81" |
| 11 | PV = "1.6.0-git${SRCPV}" | 11 | PV = "1.6.0-git${SRCPV}" |
| 12 | 12 | ||
| 13 | SRC_URI = " \ | 13 | SRC_URI = " \ |
| 14 | git://github.com/intel-iot-devkit/${BPN}.git;protocol=http \ | 14 | git://github.com/intel-iot-devkit/${BPN}.git;protocol=http \ |
| 15 | file://0001-Replace-strncpy-with-memcpy.patch \ | ||
| 15 | " | 16 | " |
| 16 | 17 | ||
| 17 | S = "${WORKDIR}/git" | 18 | S = "${WORKDIR}/git" |
