]> git.ipfire.org Git - thirdparty/libvirt.git/commitdiff
Correct checking of virStrcpyStatic() return value
authorKyle Mestery <kmestery@cisco.com>
Wed, 3 Oct 2012 19:46:55 +0000 (15:46 -0400)
committerCole Robinson <crobinso@redhat.com>
Thu, 18 Oct 2012 17:12:16 +0000 (13:12 -0400)
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@cisco.com>
(cherry picked from commit 83aebf6de4e2902c621edcba65de1d1556bee454)

src/util/virnetdevvportprofile.c

index d774fb1add47fc469a0b0117300bc2d925896627..ac7aa5fcbf4038d7ae18b2c7610ee5678c4a97f1 100644 (file)
@@ -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",