don't segfault on not found MoM

If the MoM is not found on the server to match the os version on which
you're running, swupd search's MoM downloader returns 0 instead of an
error.  EMOM_NOTFOUND is a natural value to return.

When 0 is returned, the null MoM pointer is later derferenced leading to a
segfault.

Signed-off-by: Tim Pepper <timothy.c.pepper@linux.intel.com>
This commit is contained in:
Tim Pepper
2016-06-27 11:37:06 -07:00
parent f118ea880a
commit 874fd64459
+1 -1
View File
@@ -410,7 +410,7 @@ int download_manifests(struct manifest **MoM)
*MoM = load_mom(current_version);
if (!(*MoM)) {
printf("Cannot load official manifest MoM for version %i\n", current_version);
return ret;
return EMOM_NOTFOUND;
}
subscription_versions_from_MoM(*MoM, 0);