https://bugs.kde.org/show_bug.cgi?id=514151

            Bug ID: 514151
           Summary: Okteta reads structure fields at incorrect offset
                    following "oversized" array
    Classification: Applications
           Product: okteta
      Version First 0.26.24
       Reported In:
          Platform: Debian testing
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: Structures Tool
          Assignee: [email protected]
          Reporter: [email protected]
                CC: [email protected]
  Target Milestone: ---

SUMMARY
I'm finding the structures tool is very useful! When dealing with structures
with large arrays, though, Okteta only reads the first 65535 values if the
array is specified (dynamically from a length field in the file, for example)
as having a greater length. This is understandable to ensure memory isn't
exhausted, however from my testing it appears that if other structure fields
exist after an "oversized" array, then Okteta reads the remaining file data
from the wrong offset in the file. It would be more useful if Okteta simply
skipped the "extra" array elements, and read the remaining structure fields
from the correct offsets in the file.

STEPS TO REPRODUCE
1. Configure a file format structure which contains an array with length
greater than 65535, e.g. 100k. This can be as simple as an array of uint8. Add
another field after the array, e.g. a uint32.
2. Create a file to match, e.g. 100k zeros followed by 4 bytes of 0xFF.
3. Open the file in Okteta and read it using the structure.

OBSERVED RESULT
The array is truncated, as expected. The following (uint32) field is read at
the offset immediately following the 65535th element of the array, and not
where the actual field is located within the file.

EXPECTED RESULT
The field following the array is read from the correct offset in the file,
after the entire oversized array.

SOFTWARE/OS VERSIONS
Operating System: Debian GNU/Linux 
KDE Plasma Version: 6.5.4
KDE Frameworks Version: 6.20.0
Qt Version: 6.9.2
Kernel Version: 6.17.13+deb14-amd64 (64-bit)
Graphics Platform: X11

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to