Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.1.1, 1.2.0, 1.3.0, 1.4.0
    • Fix Version/s: 2.1.0
    • Component/s: Core
    • Labels:
      None
    • Environment:
      All
    • Sprint:
      2016-12, 2016-13, 2016-15

      Description

      The function strncat is used 29 times at present, and appears to be subject to a widespread misunderstanding. The function does NOT limit the length of the result to the value of the final parameter. It limits the number of characters added to the value of the final parameter. So, a safe use of strncat would be:
      strncat(str1, str2, sizeof(str1) - sizeof(str2) - 1);
      I am not recommending that exact construction, simply giving it as an illustration of correct use of the size limit in strncat.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                johan.wikman Johan Wikman
                Reporter:
                martin brampton martin brampton
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - 4d
                  4d
                  Remaining:
                  Remaining Estimate - 4d
                  4d
                  Logged:
                  Time Spent - Not Specified
                  Not Specified