VirtualBox

Changeset 72455 in vbox for trunk


Ignore:
Timestamp:
Jun 6, 2018 12:23:08 AM (7 years ago)
Author:
vboxsync
Message:

Storage/CUE: Handle end of stream before the closing quotation mark properly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Storage/CUE.cpp

    r72293 r72455  
    566566    pToken->Type.String.psz = pTokenizer->pszInput;
    567567
    568     while (cueTokenizerGetCh(pTokenizer) != '\"')
     568    while (   !cueTokenizerIsEos(pTokenizer)
     569           && cueTokenizerGetCh(pTokenizer) != '\"')
    569570    {
    570571        cchStr++;
     
    572573    }
    573574
    574     cueTokenizerSkipCh(pTokenizer); /* Skip closing " */
    575 
    576     pToken->Type.String.cch = cchStr;
     575    /* End of stream without a closing quote is an error. */
     576    if (RT_UNLIKELY(cueTokenizerIsEos(pTokenizer)))
     577        pToken->enmType = CUETOKENTYPE_ERROR;
     578    else
     579    {
     580        cueTokenizerSkipCh(pTokenizer); /* Skip closing " */
     581        pToken->Type.String.cch = cchStr;
     582    }
    577583}
    578584
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette