Correct checking of virStrcpyStatic() return value

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>
This commit is contained in:
Kyle Mestery 2012-10-03 15:46:55 -04:00 committed by Laine Stump
parent b893e7612f
commit 83aebf6de4

View File

@ -374,7 +374,7 @@ virNetDevVPortProfileMerge(virNetDevVPortProfilePtr orig,
orig->profileID, mods->profileID); orig->profileID, mods->profileID);
return -1; return -1;
} }
if (virStrcpyStatic(orig->profileID, mods->profileID)) { if (virStrcpyStatic(orig->profileID, mods->profileID) == NULL) {
/* this should never happen - it indicates mods->profileID /* this should never happen - it indicates mods->profileID
* isn't properly null terminated. */ * isn't properly null terminated. */
virReportError(VIR_ERR_INTERNAL_ERROR, "%s", virReportError(VIR_ERR_INTERNAL_ERROR, "%s",