diff --git a/common/recipes-core/fw-util/files/system.cpp b/common/recipes-core/fw-util/files/system.cpp index 62be5cc9df17..0a965e2bab45 100644 --- a/common/recipes-core/fw-util/files/system.cpp +++ b/common/recipes-core/fw-util/files/system.cpp @@ -79,7 +79,7 @@ string System::version() char vers[128] = "NA"; FILE *fp = fopen("/etc/issue", "r"); if (fp) { - if (fscanf(fp, "OpenBMC Release %s\n", vers) == 1) { + if (fscanf(fp, "OpenBMC Release %127s\n", vers) == 1) { ret = vers; } fclose(fp); diff --git a/common/recipes-core/fw-util/files/tpm2.cpp b/common/recipes-core/fw-util/files/tpm2.cpp index ba9915e6a80b..d364a2d02a62 100755 --- a/common/recipes-core/fw-util/files/tpm2.cpp +++ b/common/recipes-core/fw-util/files/tpm2.cpp @@ -42,7 +42,7 @@ int tpm2_get_ver(char *ver, Tpm2Component *tpm2) { break; } } - fclose(fp); + pclose(fp); if (match != true) { return FW_STATUS_FAILURE;