VirtualBox

Changeset 42187 in vbox


Ignore:
Timestamp:
Jul 17, 2012 1:34:30 PM (12 years ago)
Author:
vboxsync
Message:

NAT:TFTP: earlier verification option verification and avoid of status code overwriting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Devices/Network/slirp/tftp.c

    r42180 r42187  
    291291        {
    292292            if (!RTStrICmp("blksize", g_TftpDesc[idxOptionArg].pszName))
     293            {
    293294                rc = tftpSessionParseAndMarkOption(pszTftpRRQRaw, &pTftpSession->OptionBlkSize);
    294             if (!RTStrICmp("tsize", g_TftpDesc[idxOptionArg].pszName))
     295                if (pTftpSession->OptionBlkSize.u64Value > UINT16_MAX)
     296                    rc = VERR_INVALID_PARAMETER;
     297            }
     298
     299            if (   RT_SUCCESS(rc)
     300                && !RTStrICmp("tsize", g_TftpDesc[idxOptionArg].pszName))
    295301                rc = tftpSessionParseAndMarkOption(pszTftpRRQRaw, &pTftpSession->OptionTSize);
    296             if (!RTStrICmp("timeoute", g_TftpDesc[idxOptionArg].pszName))
     302
     303            /* @todo: we don't use timeout, but its value in the range 0-255 */
     304            if (   RT_SUCCESS(rc)
     305                && !RTStrICmp("timeout", g_TftpDesc[idxOptionArg].pszName))
    297306                rc = tftpSessionParseAndMarkOption(pszTftpRRQRaw, &pTftpSession->OptionTimeout);
    298 /*
    299             @todo: process unrecognized options ??
    300             else
    301                 rc = VERR_INVALID_PARAMETER;
    302 */
     307
     308            /* @todo: unknown option detection */
    303309            if (RT_FAILURE(rc))
    304310            {
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