Ignore:
Timestamp:
05/28/11 01:47:42 (9 years ago)
Author:
Admin
Message:

Fix memcpy issues in reader-videoguard2 and smartreader module: Memcpy() has undefined behaviour if it copies data onto itself => use memmove() instead.
Fix: Set CCCam client into shutdown mode before sleeping in cleanup_thread() to prevent race conditions.
Fix some locking behaviours: A trylock with an unlock might lead to undefined behaviour if the lock was not gained.
Fix: If a thread holds a mutex and is killed, a deadlock may arise as the mutex never gets unlocked. Thus, the mutex is now saved in the client structure and cleaned up in cleanup_thread().

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/oscam-http-helpers.c

    r5239 r5304  
    849849void SSL_locking_function(int32_t mode, int32_t type, const char *file, int32_t line){
    850850    if (mode & CRYPTO_LOCK) {
    851         pthread_mutex_lock(&lock_cs[type]);
     851        cs_lock(&lock_cs[type]);
    852852    } else {
    853         pthread_mutex_unlock(&lock_cs[type]);
     853        cs_unlock(&lock_cs[type]);
    854854    }
    855855    // just to remove compiler warnings...
     
    873873void SSL_dyn_lock_function(int32_t mode, struct CRYPTO_dynlock_value *l, const char *file, int32_t line){
    874874    if (mode & CRYPTO_LOCK) {
    875         pthread_mutex_lock(&l->mutex);
     875        cs_lock(&l->mutex);
    876876    } else {
    877         pthread_mutex_unlock(&l->mutex);
     877        cs_unlock(&l->mutex);
    878878    }
    879879    // just to remove compiler warnings...
Note: See TracChangeset for help on using the changeset viewer.