VirtualBox

Ignore:
Timestamp:
Oct 7, 2021 9:03:15 PM (3 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
147348
Message:

NAT/tftp: bugref:9350 - Fix the type and the hungarian prefix of the
filename array. While here, move it to the end of the structure.

File:
1 edited

Legend:

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

    r82968 r91623  
    6565{
    6666    int         fInUse;
    67     unsigned char pszFilename[TFTP_FILENAME_MAX];
    6867    struct      in_addr IpClientAddress;
    6968    uint16_t    u16ClientPort;
     
    7574    TFPTPSESSIONOPTDESC OptionTSize;
    7675    TFPTPSESSIONOPTDESC OptionTimeout;
     76
     77    char szFilename[TFTP_FILENAME_MAX];
    7778} TFTPSESSION, *PTFTPSESSION, **PPTFTPSESSION;
    7879
     
    151152    else
    152153    {
    153         char *pszFullPathAbs = RTPathAbsExDup(tftp_prefix, (const char *)pcTftpSession->pszFilename, RTPATH_STR_F_STYLE_HOST);
     154        char *pszFullPathAbs = RTPathAbsExDup(tftp_prefix, pcTftpSession->szFilename, RTPATH_STR_F_STYLE_HOST);
    154155
    155156        if (   !pszFullPathAbs
     
    289290            break;
    290291
    291         if (RTStrNLen((char *)pTftpSession->pszFilename, TFTP_FILENAME_MAX) == 0)
    292         {
    293             rc = RTStrCopy((char *)pTftpSession->pszFilename, TFTP_FILENAME_MAX, pszTftpRRQRaw);
     292        if (RTStrNLen(pTftpSession->szFilename, TFTP_FILENAME_MAX) == 0)
     293        {
     294            rc = RTStrCopy(pTftpSession->szFilename, TFTP_FILENAME_MAX, pszTftpRRQRaw);
    294295            if (RT_FAILURE(rc))
    295296            {
     
    424425    LogFlowFuncEnter();
    425426
    426     cchSessionFilename = RTStrPrintf2(szSessionFilename, TFTP_FILENAME_MAX, "%s/%s", tftp_prefix, pTftpSession->pszFilename);
     427    cchSessionFilename = RTStrPrintf2(szSessionFilename, TFTP_FILENAME_MAX, "%s/%s", tftp_prefix, pTftpSession->szFilename);
    427428    if (cchSessionFilename > 0)
    428429    {
     
    438439        rc = VERR_FILENAME_TOO_LONG;
    439440    if (fVerbose)
    440         LogRel(("NAT TFTP: %s/%s -> %Rrc\n", tftp_prefix, pTftpSession->pszFilename, rc));
     441        LogRel(("NAT TFTP: %s/%s -> %Rrc\n", tftp_prefix, pTftpSession->szFilename, rc));
    441442    LogFlowFuncLeaveRC(rc);
    442443    return rc;
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