Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-3008

fwrite on stream opened with open_memstream() truncates the buffer size

    • None
    • Important
    • 2
    • rhel-sst-pt-libraries
    • ssg_platform_tools
    • 5
    • False
    • Hide

      None

      Show
      None
    • Yes
    • SST PT Libraries Sprint 10, SST PT Libraries Sprint 11
    • None
    • None
    • Bug Fix
    • Hide
      Cause (the user action or circumstances that trigger the bug):
      Consequence (what the user experience is when the bug occurs):
      Fix (what has changed to fix the bug; do not include overly technical details):
      Result (what happens now that the patch is applied):
      Show
      Cause (the user action or circumstances that trigger the bug): Consequence (what the user experience is when the bug occurs): Fix (what has changed to fix the bug; do not include overly technical details): Result (what happens now that the patch is applied):
    • Proposed
    • None

      Current output:

      """
      Running test: fopen()
      position after fwrite: 24
      position after SEEK_END: 24

      Running test: fmemopen()
      position after fwrite: 24
      position after SEEK_END: 24

      Running test: open_memstream()
      position after fwrite: 24
      position after SEEK_END: 4

      open_memstream() final buffer size: 4
      """

      Expected ouput:
      """
      Running test: fopen()
      position after fwrite: 24
      position after SEEK_END: 24

      Running test: fmemopen()
      position after fwrite: 24
      position after SEEK_END: 24

      Running test: open_memstream()
      position after fwrite: 24
      position after SEEK_END: 24

      open_memstream() final buffer size: 24
      """

      The seek to the start of the buffer, and write data smaller than
      the stream length truncates the memory stream.

              rhn-engineering-dj DJ Delorie
              rhn-support-pandrade Paulo Andrade
              Platform Tools - Libraries Bot Platform Tools - Libraries Bot
              Sergey Kolosov Sergey Kolosov
              Votes:
              1 Vote for this issue
              Watchers:
              12 Start watching this issue

                Created:
                Updated:
                Resolved: