Additional error handling for rarer states.
Ensure std::map::at is not blindly applied without checking that the key actually exists. Fixes crashes where u2f client on PC/browser expects channel open, but service has been restarted.
This commit is contained in:
@@ -186,7 +186,10 @@ FILE* initHTML(FILE* fPtr, const string& title) {
|
||||
void closeHTML(FILE* fPtr) {
|
||||
fprintf(fPtr, "\t</body>\n"
|
||||
"</html>");
|
||||
fclose(fPtr);
|
||||
int successCode = fclose(fPtr);
|
||||
|
||||
if (successCode != 0)
|
||||
cerr << "File closing error: " << errno << endl;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user