mirror of
https://github.com/pbatard/rufus.git
synced 2025-05-22 10:55:19 -04:00
[ui] fix more potential notification message truncation
* Some Thai UTF-8 notification messages went over the buffer size limit we used for vsnprintf()
* Also, revert part of 645184f11e
and use LRE+PDF marks instead:
Don't handle in the code what is better handled in the loc file.
This commit is contained in:
parent
d6e6f46029
commit
8238de67e1
4 changed files with 20 additions and 27 deletions
13
src/stdlg.c
13
src/stdlg.c
|
@ -774,16 +774,19 @@ BOOL Notification(int type, const notification_info* more_info, char* title, cha
|
|||
{
|
||||
BOOL ret;
|
||||
va_list args;
|
||||
const int max_msg_size = 1024;
|
||||
|
||||
dialog_showing++;
|
||||
szMessageText = (char*)malloc(MAX_PATH);
|
||||
if (szMessageText == NULL) return FALSE;
|
||||
szMessageText = (char*)malloc(max_msg_size);
|
||||
if (szMessageText == NULL)
|
||||
return FALSE;
|
||||
szMessageTitle = safe_strdup(title);
|
||||
if (szMessageTitle == NULL) return FALSE;
|
||||
if (szMessageTitle == NULL)
|
||||
return FALSE;
|
||||
va_start(args, format);
|
||||
safe_vsnprintf(szMessageText, MAX_PATH-1, format, args);
|
||||
safe_vsnprintf(szMessageText, max_msg_size -1, format, args);
|
||||
va_end(args);
|
||||
szMessageText[MAX_PATH-1] = 0;
|
||||
szMessageText[max_msg_size -1] = 0;
|
||||
notification_more_info = more_info;
|
||||
notification_is_question = FALSE;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue