meta-openembedded/meta-networking/recipes-support/strongswan/files/0001-enum-Fix-compiler-warning.patch
Yi Zhao 1cd38eed74 strongswan: upgrade 5.9.5 -> 5.9.6
* Drop backport patch 0001-openssl-Don-t-unload-providers.patch

* Backport a patch to fix the build error:
src/libstrongswan/utils/enum.c: In function 'enum_flags_to_string':
src/libstrongswan/utils/enum.c💯9: error: format not a string literal and no format arguments [-Werror=format-security]
  100 |         if (snprintf(buf, len, e->names[0]) >= len)
      |         ^~

Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 689e8422b836d804d9ab102cb3de0a4f6e1f24c8)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
2022-07-04 09:25:31 -04:00

32 lines
926 B
Diff

From d23c0ea81e630af3cfda89aeeb52146c0c84c960 Mon Sep 17 00:00:00 2001
From: Tobias Brunner <tobias@strongswan.org>
Date: Mon, 2 May 2022 09:31:49 +0200
Subject: [PATCH] enum: Fix compiler warning
Closes strongswan/strongswan#1025
Upstream-Status: Backport
[https://github.com/strongswan/strongswan/commit/d23c0ea81e630af3cfda89aeeb52146c0c84c960]
Signed-off-by: Yi Zhao <yi.zhao@windriver.com>
---
src/libstrongswan/utils/enum.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/libstrongswan/utils/enum.c b/src/libstrongswan/utils/enum.c
index 79da450f0c..1e77489f6f 100644
--- a/src/libstrongswan/utils/enum.c
+++ b/src/libstrongswan/utils/enum.c
@@ -97,7 +97,7 @@ char *enum_flags_to_string(enum_name_t *e, u_int val, char *buf, size_t len)
return buf;
}
- if (snprintf(buf, len, e->names[0]) >= len)
+ if (snprintf(buf, len, "%s", e->names[0]) >= len)
{
return NULL;
}
--
2.25.1