Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Commit 4154995

Browse files
authored
Merge pull request #426 from sbatten/nullptr
Add guard against null to match remainder of calls in file
2 parents 1248408 + a3de0ec commit 4154995

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/keytar_win.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ KEYTAR_OP_RESULT FindCredentials(const std::string& service,
228228
std::vector<Credentials>* credentials,
229229
std::string* errStr) {
230230
LPWSTR filter = utf8ToWideChar(service + "*");
231+
if (filter == NULL) {
232+
*errStr = "Error generating credential filter";
233+
return FAIL_ERROR;
234+
}
231235

232236
DWORD count;
233237
CREDENTIAL **creds;

0 commit comments

Comments
 (0)