[PATCH 02/16] virProcessRunInForkHelper: Use virStrcpyStatic for static buffers

Peter Krempa posted 16 patches 4 years, 11 months ago
[PATCH 02/16] virProcessRunInForkHelper: Use virStrcpyStatic for static buffers
Posted by Peter Krempa 4 years, 11 months ago
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
---
 src/util/virprocess.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/util/virprocess.c b/src/util/virprocess.c
index 69d64e9466..7a0960e337 100644
--- a/src/util/virprocess.c
+++ b/src/util/virprocess.c
@@ -1168,14 +1168,14 @@ virProcessRunInForkHelper(int errfd,

             bin->data.code = err->code;
             bin->data.domain = err->domain;
-            ignore_value(virStrcpy(bin->data.message, err->message, sizeof(bin->data.message)));
+            virStrcpyStatic(bin->data.message, err->message);
             bin->data.level = err->level;
             if (err->str1)
-                ignore_value(virStrcpy(bin->data.str1, err->str1, sizeof(bin->data.str1)));
+                virStrcpyStatic(bin->data.str1, err->str1);
             if (err->str2)
-                ignore_value(virStrcpy(bin->data.str2, err->str2, sizeof(bin->data.str2)));
+                virStrcpyStatic(bin->data.str2, err->str2);
             if (err->str3)
-                ignore_value(virStrcpy(bin->data.str3, err->str3, sizeof(bin->data.str3)));
+                virStrcpyStatic(bin->data.str3, err->str3);
             bin->data.int1 = err->int1;
             bin->data.int2 = err->int2;

-- 
2.29.2

Re: [PATCH 02/16] virProcessRunInForkHelper: Use virStrcpyStatic for static buffers
Posted by Ján Tomko 4 years, 11 months ago
On a Tuesday in 2021, Peter Krempa wrote:
>Signed-off-by: Peter Krempa <pkrempa@redhat.com>
>---
> src/util/virprocess.c | 8 ++++----
> 1 file changed, 4 insertions(+), 4 deletions(-)
>

Reviewed-by: Ján Tomko <jtomko@redhat.com>

Jano