DirectFB - Home of the pragmatist Roadmap


[directfb-dev] Directfb segfaults when *argc is 0 in misc/conf.c
Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[directfb-dev] Directfb segfaults when *argc is 0 in misc/conf.c



Hello,

during my work for the gtk frontend of debian-installer I encounterd a
bug in directfb.

When trying to find executable specific configuration, directfb
segfaults if there is no calling program. At least I believe that this
is the cause.

The segfault happend at the (*) starred line:

,----[DirectFB-0.9.15/src/misc/conf.c, Line 683]
| DFBResult dfb_config_init( int *argc, char **argv[] )
| {
|      DFBResult ret;
|      int i;
|      char *home = getenv( "HOME" );
|      char *prog = NULL;
| 
|      if (dfb_config)
|           return DFB_OK;
| 
|      config_allocate();
| 
|      ret = dfb_config_read( "/etc/directfbrc" );
|      if (ret  &&  ret != DFB_IO)
|           return ret;
| 
|      if (argc && argv) {
|*          prog = strrchr( (*argv)[0], '/' );
| 
|           if (prog)
|                prog++;
|           else
|                prog = (*argv)[0];
|      }
`----

argc and argv were valid pointers, so the if clause was entered. But
*argc was 0x0 so (*argv)[0] was a nullpointer dereferenciation.

I hope that helps.
Sebastian Ley

-- 
PGP-Key: http://www.mmweg.rwth-aachen.de/~sebastian.ley/public.key
Fingerprint: A46A 753F AEDC 2C01 BE6E  F6DB 97E0 3309 9FD6 E3E6

Attachment: pgp00027.pgp
Description: PGP signature


Home | Main Index | Thread Index


directfb.org / Development / Old Archives