Changeset 5719f6d in mainline


Ignore:
Timestamp:
2008-07-25T10:26:20Z (16 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
61bacde
Parents:
4e4052b
Message:

Check the validity of the 'len' argument for sysinfo syscalls.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/generic/src/sysinfo/sysinfo.c

    r4e4052b r5719f6d  
    282282}
    283283
     284#define SYSINFO_MAX_LEN 1024
     285
    284286unative_t sys_sysinfo_valid(unative_t ptr, unative_t len)
    285287{
    286288        char *str;
    287289        sysinfo_rettype_t ret = {0, 0};
     290
     291        if (len > SYSINFO_MAX_LEN)
     292                return ret.valid;
    288293        str = malloc(len + 1, 0);
    289294       
     
    300305        char *str;
    301306        sysinfo_rettype_t ret = {0, 0};
     307       
     308        if (len > SYSINFO_MAX_LEN)
     309                return ret.val;
    302310        str = malloc(len + 1, 0);
    303311       
Note: See TracChangeset for help on using the changeset viewer.