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