agent.c: check return code of MapViewOfFile
Fixes VS2012 code analysis warning C6387: 'p+4' may be '0': this does not adhere to the specification for the function 'memcpy': libssh2 agent.c 330 Fixes VS2012 code analysis warning C6387: 'p' may be '0': this does not adhere to the specification for the function 'UnmapViewOfFile': libssh2 agent.c 333
This commit is contained in:
parent
977dbb7511
commit
abcc0d370f
@ -303,6 +303,12 @@ agent_transact_pageant(LIBSSH2_AGENT *agent, agent_transaction_ctx_t transctx)
|
|||||||
"failed setting up pageant filemap");
|
"failed setting up pageant filemap");
|
||||||
|
|
||||||
p2 = p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
|
p2 = p = MapViewOfFile(filemap, FILE_MAP_WRITE, 0, 0, 0);
|
||||||
|
if (p == NULL || p2 == NULL) {
|
||||||
|
CloseHandle(filemap);
|
||||||
|
return _libssh2_error(agent->session, LIBSSH2_ERROR_AGENT_PROTOCOL,
|
||||||
|
"failed to open pageant filemap for writing");
|
||||||
|
}
|
||||||
|
|
||||||
_libssh2_store_str(&p2, (const char *)transctx->request,
|
_libssh2_store_str(&p2, (const char *)transctx->request,
|
||||||
transctx->request_len);
|
transctx->request_len);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user