Ignore:
Timestamp:
Jul 17, 2000, 8:37:33 PM (25 years ago)
Author:
sandervl
Message:

misc updates

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sbliveos2/trunk/lib32/memory.cpp

    r148 r152  
    129129void __copy_user(void *to, const void *from, unsigned long n)
    130130{
     131        if(to == NULL || from == NULL) {
     132                DebugInt3();
     133                return;
     134        }
     135        if(n == 0) return;
    131136#ifdef KEE
    132137        memcpy(to, from, n);
     
    139144unsigned long copy_to_user(void *to, const void *from, unsigned long n)
    140145{
     146        if(to == NULL || from == NULL) {
     147                DebugInt3();
     148                return 0;
     149        }
     150        if(n == 0) return 0;
    141151#ifdef KEE
    142152        memcpy(to, from, n);
     
    150160void __copy_user_zeroing(void *to, const void *from, unsigned long n)
    151161{
     162        if(to == NULL || from == NULL) {
     163                DebugInt3();
     164                return;
     165        }
     166        if(n == 0) return;
    152167        copy_to_user(to, from, n);
    153168}
     
    156171unsigned long copy_from_user(void *to, const void *from, unsigned long n)
    157172{
     173        if(to == NULL || from == NULL) {
     174                DebugInt3();
     175                return 0;
     176        }
     177        if(n == 0) return 0;
    158178#ifdef KEE
    159179        memcpy(to, from, n);
     
    167187int get_user(int size, void *dest, void *src)
    168188{
     189        if(size == 0)   return 0;
     190
     191        if(dest == NULL || src == NULL) {
     192                DebugInt3();
     193                return 0;
     194        }
    169195#ifdef KEE
    170196        memcpy(dest, src, size);
     
    178204int put_user(int x, void *ptr)
    179205{
     206        if(ptr == NULL) {
     207                DebugInt3();
     208                return 0;
     209        }
     210
    180211        *(int *)ptr = x;
    181212        return 0;
     
    200231 char near *addr;
    201232
     233  if(size == 0) {
     234        DebugInt3();
     235        return NULL;
     236  }
    202237  if(size > 1024) {
    203238#ifdef KEE
Note: See TracChangeset for help on using the changeset viewer.