Menu

#330 TStorageDocument::GetProperty fails in Unicode build mode

unspecified
open
nobody
1
2024-04-02
2015-11-04
No

Function ocf::TStorageDocument::GetProperty, implemented in "source/ocf/stgdoc.cpp" (line 744), does not take character size into account when copying the result to the given text buffer, and hence fails for wide strings (Unicode build mode).

Related

Bugs: #571
Feature Requests: #242

Discussion

  • Vidar Hasfjord

    Vidar Hasfjord - 2024-03-30
    • labels: OCF --> OCF, Internal, Unicode
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2024-04-01

    Here is a proposed fix, mirroring the code for TFileDocument::GetProperty:

    - memcpy(dest, buf, textlen);
    + memcpy(dest, buf, textlen*sizeof(tchar));
    
     
  • Vidar Hasfjord

    Vidar Hasfjord - 2024-04-02

    See also "TFileDocument::GetProperty (StorageSize): Buffer overflow" [bugs:#573].

     

    Related

    Bugs: #573


Log in to post a comment.