[libvirt] [PATCH] Correct checking of virStrcpyStatic() return value

Kyle Mestery kmestery at cisco.com
Wed Oct 3 19:46:55 UTC 2012


Correct the check for the return value of virStrcpyStatic()
when copying port-profile names. Fixes Open vSwitch ports
which utilize port-profiles from network definitions.

Signed-off-by: Kyle Mestery <kmestery at cisco.com>
---
 src/util/virnetdevvportprofile.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/util/virnetdevvportprofile.c b/src/util/virnetdevvportprofile.c
index d774fb1..ac7aa5f 100644
--- a/src/util/virnetdevvportprofile.c
+++ b/src/util/virnetdevvportprofile.c
@@ -374,7 +374,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig,
                            orig->profileID, mods->profileID);
             return -1;
         }
-        if (virStrcpyStatic(orig->profileID, mods->profileID)) {
+        if (virStrcpyStatic(orig->profileID, mods->profileID) == NULL) {
             /* this should never happen - it indicates mods->profileID
              * isn't properly null terminated. */
             virReportError(VIR_ERR_INTERNAL_ERROR, "%s",
-- 
1.7.11.4




More information about the libvir-list mailing list