Skip to content

Commit

Permalink
Changed ASOMSG_Length to ASOMSG_Size. ASOMSG_Length only changes
Browse files Browse the repository at this point in the history
what is stored in mn_Length. It does not change the allocation
size used so anything written past the normal message structure
would have trashed innocent memory in earlier versions.
  • Loading branch information
salass00 committed Sep 30, 2016
1 parent 7eb058b commit 4143715
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions src/cli.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ int cli_main(struct LocaleInfo *loc) {
}

startup_msg = IExec->AllocSysObjectTags(ASOT_MESSAGE,
ASOMSG_Name, PROGNAME " startup message",
ASOMSG_Length, sizeof(*startup_msg),
ASOMSG_Name, PROGNAME " startup message",
ASOMSG_Size, sizeof(*startup_msg),
TAG_END);
if (startup_msg == NULL) {
IDOS->PrintFault(ERROR_NO_FREE_STORE, PROGNAME);
Expand Down Expand Up @@ -102,7 +102,7 @@ int cli_main(struct LocaleInfo *loc) {
death_msg = IExec->AllocSysObjectTags(ASOT_MESSAGE,
ASOMSG_Name, PROGNAME " death message",
ASOMSG_ReplyPort, mp,
ASOMSG_Length, sizeof(*death_msg),
ASOMSG_Size, sizeof(*death_msg),
TAG_END);
if (death_msg == NULL) {
IDOS->PrintFault(ERROR_NO_FREE_STORE, PROGNAME);
Expand Down
6 changes: 3 additions & 3 deletions src/gui.c
Original file line number Diff line number Diff line change
Expand Up @@ -992,16 +992,16 @@ int gui_main(struct LocaleInfo *loc, struct WBStartup *wbs) {
goto out;

gd->startup_msg = IExec->AllocSysObjectTags(ASOT_MESSAGE,
ASOMSG_Name, PROGNAME " startup message",
ASOMSG_Length, sizeof(*gd->startup_msg),
ASOMSG_Name, PROGNAME " startup message",
ASOMSG_Size, sizeof(*gd->startup_msg),
TAG_END);
if (gd->startup_msg == NULL)
goto out;

gd->death_msg = IExec->AllocSysObjectTags(ASOT_MESSAGE,
ASOMSG_Name, PROGNAME " death message",
ASOMSG_ReplyPort, gd->srec_mp,
ASOMSG_Length, sizeof(*gd->death_msg),
ASOMSG_Size, sizeof(*gd->death_msg),
TAG_END);
if (gd->death_msg == NULL)
goto out;
Expand Down

0 comments on commit 4143715

Please sign in to comment.