e16662
diff -up librtas-2.0.2/librtasevent_src/get_rtas_event.c.me librtas-2.0.2/librtasevent_src/get_rtas_event.c
e16662
--- librtas-2.0.2/librtasevent_src/get_rtas_event.c.me	2021-03-25 11:26:19.754142871 +0100
e16662
+++ librtas-2.0.2/librtasevent_src/get_rtas_event.c	2021-03-25 11:29:24.322686995 +0100
e16662
@@ -29,6 +29,10 @@
e16662
 #include "librtasevent.h"
e16662
 #include "rtas_event.h"
e16662
 
e16662
+#if __GNUC__ >= 9
e16662
+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
e16662
+#endif
e16662
+
e16662
 /**
e16662
  * rtas_copy
e16662
  * @brief front end for common memcpy calls
e16662
diff -up librtas-2.0.2/librtasevent_src/rtas_post.c.me librtas-2.0.2/librtasevent_src/rtas_post.c
e16662
--- librtas-2.0.2/librtasevent_src/rtas_post.c.me	2021-03-25 11:52:35.489805806 +0100
e16662
+++ librtas-2.0.2/librtasevent_src/rtas_post.c	2021-03-25 12:11:38.817324108 +0100
e16662
@@ -139,6 +139,7 @@ print_re_post_scn(struct scn_header *shd
e16662
 	len += rtas_print("Self-test error in firmware extended "
e16662
                           "diagnostics.\n");
e16662
 
e16662
+    /* coverity[invalid_type : FALSE] */
e16662
     len += rtas_print("POST Error Code:        %x\n", post->err_code);
e16662
     len += rtas_print("Firmware Revision Code: %x\n", post->firmware_rev);
e16662
 
e16662
diff -up librtas-2.0.2/librtasevent_src/rtas_v6_misc.c.me librtas-2.0.2/librtasevent_src/rtas_v6_misc.c
e16662
--- librtas-2.0.2/librtasevent_src/rtas_v6_misc.c.me	2021-03-25 11:29:57.445143562 +0100
e16662
+++ librtas-2.0.2/librtasevent_src/rtas_v6_misc.c	2021-03-25 11:30:05.924260442 +0100
e16662
@@ -28,6 +28,10 @@
e16662
 #include "librtasevent.h"
e16662
 #include "rtas_event.h"
e16662
 
e16662
+#if __GNUC__ >= 9
e16662
+#pragma GCC diagnostic ignored "-Waddress-of-packed-member"
e16662
+#endif
e16662
+
e16662
 /**
e16662
  * months
e16662
  * @brief array of month strings
e16662
diff -up librtas-2.0.2/librtas_src/syscall_calls.c.me librtas-2.0.2/librtas_src/syscall_calls.c
e16662
--- librtas-2.0.2/librtas_src/syscall_calls.c.me	2021-03-25 11:34:20.691775299 +0100
e16662
+++ librtas-2.0.2/librtas_src/syscall_calls.c	2021-03-25 11:49:03.830951225 +0100
e16662
@@ -886,7 +886,7 @@ int rtas_platform_dump(uint64_t dump_tag
e16662
 	uint32_t next_hi, next_lo;
e16662
 	uint32_t bytes_hi, bytes_lo;
e16662
 	uint32_t dump_tag_hi, dump_tag_lo;
e16662
-	void *kernbuf;
e16662
+	void *kernbuf = NULL;
e16662
 	int rc, status;
e16662
 
e16662
 	rc = sanity_check();
e16662
@@ -927,6 +927,7 @@ int rtas_platform_dump(uint64_t dump_tag
e16662
 	if (buffer && (rc == 0))
e16662
 		memcpy(buffer, kernbuf, length);
e16662
 
e16662
+   /* coverity[uninit_use : FALSE] */
e16662
 	if (kernbuf)
e16662
 		(void)rtas_free_rmo_buffer(kernbuf, kernbuf_pa, length);
e16662
 
e16662
diff -up librtas-2.0.2/librtas_src/syscall_rmo.c.me librtas-2.0.2/librtas_src/syscall_rmo.c
e16662
--- librtas-2.0.2/librtas_src/syscall_rmo.c.me	2021-03-25 11:49:26.704266218 +0100
e16662
+++ librtas-2.0.2/librtas_src/syscall_rmo.c	2021-03-25 12:47:12.108229574 +0100
e16662
@@ -247,6 +247,7 @@ static int get_phys_region(size_t size,
e16662
 		if (bits == 0ll) {
e16662
 			if (acquire_file_lock(i, n_pages) == 0) {
e16662
 				set_bits(i, i + n_pages - 1,
e16662
+					 /* coverity[overflow_before_widen : FALSE] */
e16662
 					 (1 << n_pages) - 1,
e16662
 					 &wa_config.pages_map);
e16662
 				addr = kregion->addr + (i * PAGE_SIZE);
e16662
@@ -289,6 +290,7 @@ static int release_phys_region(uint32_t
e16662
 
e16662
 	bits = get_bits(first_page, first_page + n_pages - 1,
e16662
 			wa_config.pages_map);
e16662
+	/* coverity[overflow_before_widen : FALSE] */
e16662
 	if (bits != ((1 << n_pages) - 1)) {
e16662
 		dbg("Invalid region [0x%x, 0x%zx]\n", phys_addr, size);
e16662
 		return RTAS_IO_ASSERT;
e16662
diff --git a/librtasevent_src/rtas_srcfru.c b/librtasevent_src/rtas_srcfru.c
e16662
index 23c8584..a2eac9a 100644
e16662
--- a/librtasevent_src/rtas_srcfru.c
e16662
+++ b/librtasevent_src/rtas_srcfru.c
e16662
@@ -74,13 +74,13 @@ parse_fru_id_scn(struct rtas_event *re)
e16662
     re->offset += RE_FRU_HDR_SZ;
e16662
 
e16662
     if (fruid_has_part_no(fru_id)) {
e16662
-        strcpy(fru_id->part_no, RE_EVENT_OFFSET(re));
e16662
-        re->offset += 8;
e16662
+        rtas_copy(fru_id->part_no, re, 7);
e16662
+        fru_id->part_no[7] = '\0';
e16662
     }
e16662
 
e16662
     if (fruid_has_proc_id(fru_id)) {
e16662
-        strcpy(fru_id->procedure_id, RE_EVENT_OFFSET(re));
e16662
-        re->offset += 8;
e16662
+        rtas_copy(fru_id->procedure_id, re, 7);
e16662
+        fru_id->procedure_id[7] = '\0';
e16662
     }
e16662
 
e16662
     if (fruid_has_ccin(fru_id)) {
e16662
@@ -238,9 +238,10 @@ parse_src_scn(struct rtas_event *re)
e16662
 
e16662
     add_re_scn(re, src, re_scn_id(&src_raw->v6hdr));
e16662
 
e16662
-    if (!src_subscns_included(src))
e16662
+    if (!src_subscns_included(src)) {
e16662
+        free (src_raw);
e16662
         return 0;
e16662
-
e16662
+    }
e16662
     rtas_copy( (char *) src_raw + RE_SRC_SCN_SZ + 4, re, RE_SRC_SUBSCN_SZ);
e16662
 
e16662
     src->subscn_id = src_raw->subscn_id;
e16662
@@ -251,6 +252,7 @@ parse_src_scn(struct rtas_event *re)
e16662
     total_len = RE_SRC_SUBSCN_SZ;
e16662
 
e16662
     last_fru = NULL;
e16662
+    free(src_raw);
e16662
 
e16662
     do {
e16662
 	uint32_t fru_len, fru_end;
e16662
@@ -288,6 +290,7 @@ parse_src_scn(struct rtas_event *re)
e16662
 
e16662
             if (cur_fruhdr == NULL) {
e16662
                 cleanup_rtas_event(re);
e16662
+                free(fru);
e16662
                 return -1;
e16662
             }
e16662
 
e16662
diff --git a/librtasevent_src/rtas_vend.c b/librtasevent_src/rtas_vend.c
e16662
index 6fa717e..2814726 100644
e16662
--- a/librtasevent_src/rtas_vend.c
e16662
+++ b/librtasevent_src/rtas_vend.c
e16662
@@ -116,6 +116,7 @@ parse_vend_errlog_scn(struct rtas_event *re)
e16662
         ve->vendor_data = malloc(ve->vendor_data_sz);
e16662
         if (ve->vendor_data == NULL) {
e16662
             errno = ENOMEM;
e16662
+            free(ve);
e16662
             return -1;
e16662
         }
e16662