mainGnuDOS - Support: sr #111114, Crashes in wcsrtombs

 
 

sr #111114: Crashes in wcsrtombs

Submitter:  cspiegel <cspiegel>
Submitted:  Fri 30 Aug 2024 03:40:32 AM UTC
   
 
Category:  None Priority:  5 - Normal
Severity:  3 - Normal Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Open Operating System:  GNU/Linux
* Mandatory Fields

Add a New Comment Rich Markup
   

Fri 30 Aug 2024 03:40:32 AM UTC, original submission:  

If the target system does not have ncursesw/ncurses.h, the HAVE_NCURSESW_NCURSES_H macro won't be set, and manual multibyte conversions are done. They're done incorrectly, however:

wchar_t wctmp[2] = { ch, L'\0' };
char cstr[16];
wcsrtombs(cstr, (const wchar_t **)&wctmp, 1, NULL);

Here wctmp is an array so &wctmp is a pointer to an array, not a pointer to a pointer.  I've found two places where this occurs, and they cause crashing when quitting prime, or trying to edit a file in mino.

I'm attaching a patch which solves the issue.

cspiegel <cspiegel>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #56397:  01-wcsrtombs.diff added by cspiegel (1KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by cspiegel (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-08-30 cspiegel Attached File- Added 01-wcsrtombs.diff, #56397

    Back to the top

    Powered by Savane 3.15-26b0.
    Corresponding source code