Skip to content

Commit

Permalink
PDF: fix potential heap buffer overflow. Fixes https://bugs.chromium.…
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Aug 19, 2019
1 parent 069d9b8 commit 8c28547
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gdal/frmts/pdf/pdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5039,6 +5039,8 @@ static double Get(GDALPDFObject* poObj, int nIndice)
{
const char* pszStr = poObj->GetString().c_str();
size_t nLen = strlen(pszStr);
if( nLen == 0 )
return 0;
/* cf Military_Installations_2008.pdf that has values like "96 0 0.0W" */
char chLast = pszStr[nLen-1];
if (chLast == 'W' || chLast == 'E' || chLast == 'N' || chLast == 'S')
Expand Down

0 comments on commit 8c28547

Please sign in to comment.