Hi Willi,

-1 for this patch...

please see gwlib/octstr.c:
static Octstr *immutables[MAX_IMMUTABLES];

it's never NULL...

Wilfried Goesgens wrote:

> I've struggled over some condition making octstr_imm stumble,
> this check keeps it from segfaulting.
> 
> sincerely,
> Wilfried Goesgens
> 
> 
> 
> gwlib/octstr.c        2005-04-13 18:13:38.000000000 +0200
> +++ octstr.c    2005-04-13 18:49:03.000000000 +0200
> @@ -285,7 +285,7 @@ Octstr *octstr_imm(const char *cstr)
>      mutex_lock(&immutables_mutex);
>      i = index;
>      for (; ; ) {
> -       if (immutables[i] == NULL || immutables[i]->data == data)
> +       if (immutables == NULL || immutables[i] == NULL ||
> immutables[i]->data == data)
>              break;
>          i = (i + 1) % MAX_IMMUTABLES;
>          if (i == index)

-- 
Thanks,
Alex


Reply via email to