Changeset bd9e868 in mainline


Ignore:
Timestamp:
2018-07-05T16:17:08Z (6 years ago)
Author:
Jiří Zárevúcky <jiri.zarevucky@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
acf6b55
Parents:
63d46341
git-author:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-05 16:01:00)
git-committer:
Jiří Zárevúcky <jiri.zarevucky@…> (2018-07-05 16:17:08)
Message:

Fix possible NULL dereferences in async.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/lib/c/generic/async/client.c

    r63d46341 rbd9e868  
    186186static void amsg_destroy(amsg_t *msg)
    187187{
     188        if (!msg)
     189                return;
     190
    188191        assert(!msg->destroyed);
    189192        msg->destroyed = true;
     
    352355void async_wait_for(aid_t amsgid, errno_t *retval)
    353356{
    354         assert(amsgid);
     357        if (amsgid == 0) {
     358                if (retval)
     359                        *retval = ENOMEM;
     360                return;
     361        }
    355362
    356363        amsg_t *msg = (amsg_t *) amsgid;
     
    397404errno_t async_wait_timeout(aid_t amsgid, errno_t *retval, suseconds_t timeout)
    398405{
    399         assert(amsgid);
     406        if (amsgid == 0) {
     407                if (retval)
     408                        *retval = ENOMEM;
     409                return EOK;
     410        }
    400411
    401412        amsg_t *msg = (amsg_t *) amsgid;
     
    468479void async_forget(aid_t amsgid)
    469480{
     481        if (amsgid == 0)
     482                return;
     483
    470484        amsg_t *msg = (amsg_t *) amsgid;
    471485
    472         assert(msg);
    473486        assert(!msg->forget);
    474487        assert(!msg->destroyed);
Note: See TracChangeset for help on using the changeset viewer.