Ticket #4827: pthread-create-crash.patch

File pthread-create-crash.patch, 543 bytes (added by kaliber, 15 years ago)

proposed patch

  • src/system/libroot/posix/pthread/pthread.c

    diff --git a/src/system/libroot/posix/pthread/pthread.c b/src/system/libroot/posix/pthread/pthread.c
    index ef3a5c8..27f1bfb 100644
    a b pthread_create(pthread_t *_thread, const pthread_attr_t *_attr,  
    8585    if (_attr == NULL)
    8686        attr = &pthread_attr_default;
    8787    else
    88         attr = *_attr;
     88        if (attr == NULL)
     89            return EINVAL;
     90        else
     91            attr = *_attr;
    8992
    9093    thread = (pthread_thread *)malloc(sizeof(pthread_thread));
    9194    if (thread == NULL)