diff --git a/common/bstrlib/bstrwrap.cpp b/common/bstrlib/bstrwrap.cpp index 1f119ce..3f25514 100644 --- a/common/bstrlib/bstrwrap.cpp +++ b/common/bstrlib/bstrwrap.cpp @@ -1539,7 +1539,7 @@ std::istream& operator >> (std::istream& sin, CBString& b) { do { b.gets ((bNgetc) istreamGets, &sin, '\n'); if (b.slen > 0 && b.data[b.slen-1] == '\n') b.slen--; - } while (b.slen == 0 && !sin.eof ()); + } while (b.slen == 0 && !sin.eof() && !sin.fail()); return sin; } diff --git a/common/ffsparser.cpp b/common/ffsparser.cpp index c46657e..c4c8698 100644 --- a/common/ffsparser.cpp +++ b/common/ffsparser.cpp @@ -2886,6 +2886,7 @@ USTATUS FfsParser::parseDepexSectionBody(const UModelIndex & index) msg(usprintf("%s: DEPEX section ends with non-END opcode", __FUNCTION__), index); return U_SUCCESS; } + // No further parsing required return U_SUCCESS; case EFI_DEP_AFTER: if (body.size() != 2 * EFI_DEP_OPCODE_SIZE + sizeof(EFI_GUID)){ @@ -2899,6 +2900,7 @@ USTATUS FfsParser::parseDepexSectionBody(const UModelIndex & index) msg(usprintf("%s: DEPEX section ends with non-END opcode", __FUNCTION__), index); return U_SUCCESS; } + // No further parsing required return U_SUCCESS; case EFI_DEP_SOR: if (body.size() <= 2 * EFI_DEP_OPCODE_SIZE) { @@ -2967,8 +2969,8 @@ USTATUS FfsParser::parseDepexSectionBody(const UModelIndex & index) break; default: msg(usprintf("%s: unknown opcode %02Xh", __FUNCTION__, *current), index); + // No further parsing required return U_SUCCESS; - break; } }