ppc64-diag/ppc64-diag-2.7.9-compiler-warnings.patch
Than Ngo 7a4d6633db - man and help of diag_nvme are not in sync
- compiler warnings
- diag_nvme: call_home command fails on nvmf drive
- rtas_errd: Fix core dump with large filename passed to -f option

Resolves: RHEL-55398
2024-12-03 10:19:47 +01:00

44 lines
1.7 KiB
Diff

diff --git a/lpd/usysident.c b/lpd/usysident.c
index 8fee736..11a512b 100644
--- a/lpd/usysident.c
+++ b/lpd/usysident.c
@@ -429,7 +429,7 @@ retry:
* next elements in the list (which may match the device name);
* for this we need to retry, re-starting on the next element.
*/
- if (dvalue && current->devname &&
+ if (dvalue && current->devname[0] != '\0' &&
strncmp(dvalue, current->devname, DEV_LENGTH)) {
list_start = current->next;
goto retry;
diff --git a/opal_errd/extract_opal_dump.c b/opal_errd/extract_opal_dump.c
index b7f365f..656899d 100644
--- a/opal_errd/extract_opal_dump.c
+++ b/opal_errd/extract_opal_dump.c
@@ -77,8 +77,10 @@ static void dump_get_file_name(char *buf, int bsize, char *dfile,
if (bsize >= DUMP_HDR_PREFIX_OFFSET + sizeof(uint16_t))
*prefix_size = be16toh(*(uint16_t *)(buf + DUMP_HDR_PREFIX_OFFSET));
- if (bsize >= DUMP_HDR_FNAME_OFFSET + DUMP_MAX_FNAME_LEN)
- strncpy(dfile, buf + DUMP_HDR_FNAME_OFFSET, dfile_size);
+ if (bsize >= DUMP_HDR_FNAME_OFFSET + DUMP_MAX_FNAME_LEN) {
+ strncpy(dfile, buf + DUMP_HDR_FNAME_OFFSET, dfile_size - 1);
+ dfile[dfile_size - 1] = '\0';
+ }
else
strncpy(dfile, "platform.dumpid.PARTIAL", dfile_size);
diff --git a/rtas_errd/extract_platdump.c b/rtas_errd/extract_platdump.c
index 831e57e..50bac99 100644
--- a/rtas_errd/extract_platdump.c
+++ b/rtas_errd/extract_platdump.c
@@ -220,7 +220,7 @@ extract_platform_dump(uint64_t dump_tag)
char filename[DUMP_MAX_FNAME_LEN + 1];
char pathname[PATH_MAX];
char dump_err[RTAS_ERROR_LOG_MAX];
- char dumpid[5];
+ char dumpid[5] = "";
int out=-1, rc, librtas_rc, dump_complete=0, ret=0;
msg("Dump tag: 0x%016LX", dump_tag);