Skip to content

Commit

Permalink
Bug 1323150 - fix large certs on win32, r=mt,rrelyea
Browse files Browse the repository at this point in the history
--HG--
extra : rebase_source : 404a9b05731c739024b8301fe7c6fc7ed57632d0
  • Loading branch information
franziskuskiefer committed Dec 28, 2016
1 parent aa511a4 commit a48dc05
Showing 1 changed file with 6 additions and 12 deletions.
18 changes: 6 additions & 12 deletions lib/softoken/legacydb/dbmshim.c
Expand Up @@ -334,18 +334,12 @@ dbs_readBlob(DBS *dbsp, DBT *data)
}

len = dbs_getBlobSize(data);
mapfile = PR_CreateFileMap(filed, len, PR_PROT_READONLY);
if (mapfile == NULL) {
/* USE PR_GetError instead of PORT_GetError here
* because we are getting the error from PR_xxx
* function */
if (PR_GetError() != PR_NOT_IMPLEMENTED_ERROR) {
goto loser;
}
addr = dbs_EmulateMap(filed, len);
} else {
addr = PR_MemMap(mapfile, 0, len);
}
/* Bug 1323150
* PR_MemMap fails on Windows for larger certificates.
* https://msdn.microsoft.com/en-us/library/windows/desktop/aa366761(v=vs.85).aspx
* Let's always use the emulated map, i.e. read the file.
*/
addr = dbs_EmulateMap(filed, len);
if (addr == NULL) {
goto loser;
}
Expand Down

0 comments on commit a48dc05

Please sign in to comment.