fix the compilation error

This commit is contained in:
zhoushuiqing 2023-07-26 14:15:16 +08:00
parent 73bccc35e6
commit 33e243a1fb
2 changed files with 39 additions and 1 deletions

View File

@ -1,6 +1,6 @@
name: digest-list-tools
Version: 0.3.95
Release: 12
Release: 13
Summary: Utilities for IMA Digest Lists extension
Source0: https://gitee.com/openeuler/%{name}/repository/archive/v%{version}.tar.gz
@ -17,6 +17,7 @@ Patch5: fix-faulty-code.patch
Patch6: fix-file-resource-leakage-and-memory-leakage.patch
Patch7: fix-error-exit-in-dracut-program.patch
Patch8: fix-cap_struct-to-adapter-libcap-2.61.patch
Patch9: fix-the-compilation-error.patch
Requires: libcap >= 2.61
BuildRequires: autoconf automake libcurl-devel libtool rpm-devel dracut gzip
@ -129,6 +130,9 @@ rm -rf $RPM_BUILD_ROOT
%{_mandir}/man1/%{name}.1.gz
%changelog
* Wed Jul 26 2023 zhoushuiqing <zhoushuiqing2@huawei.com> - 0.3.95-13
- fix the compilation error caused by the -Werror=address compilation option in gcc.
* Wed May 24 2023 zhoushuiqing <zhoushuiqing2@huawei.com> - 0.3.95-12
- Fix cap_struct to adapter libcap 2.61

View File

@ -0,0 +1,34 @@
From b2bc3931f2dee4c5ef81fe3f6b5bdbca1ed4a6bf Mon Sep 17 00:00:00 2001
From: zhoushuiqing <zhoushuiqing2@huawei.com>
Date: Wed, 26 Jul 2023 11:44:14 +0800
Subject: [PATCH] fix the compilation error caused by the -Werror=address compilation option in gcc.
---
parsers/compact_tlv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/parsers/compact_tlv.c b/parsers/compact_tlv.c
index 3cd3b95..6b8ca99 100644
--- a/parsers/compact_tlv.c
+++ b/parsers/compact_tlv.c
@@ -115,7 +115,7 @@ int parser(int fd, struct list_head *head, loff_t size, void *buf,
modifiers = hdr.modifiers;
for (j = 0; j < 4; j++) {
- if (!items_data(ID_INODE_UID + j))
+ if (items_data(ID_INODE_UID + j) == NULL)
continue;
i_meta[j] =
@@ -152,7 +152,7 @@ int parser(int fd, struct list_head *head, loff_t size, void *buf,
break;
case PARSER_OP_ADD_META_DIGEST:
case PARSER_OP_ADD_META_DIGEST_TO_HTABLE:
- if (!items_data(ID_EVM_DIGEST)) {
+ if (items_data(ID_EVM_DIGEST) == NULL) {
ret = calc_metadata_digest(fd, head,
hdr.type, modifiers,
hdr.algo, items_data(ID_DIGEST),
--
2.33.0