#17 Segment violation

closed-duplicate
None
5
2004-03-11
2004-03-10
Anonymous
No

The version 0.10 code base has a logic problem when
aide is run with the option --config-check

Here is the gdb back trace showing mhase is called with
td=null causing the bang!

#0 mhash (td=0x0, plaintext=0x811ef68, size=1) at
mhash.c:348
#1 0x0804be23 in conf_input_wrapper (buf=0x811ef68
"#", max_size=8192, in=0x0) at commandconf.c:229
#2 0x08049a3a in yy_get_next_buffer () at conf_lex.c:5340
#3 0x080497cd in conflex () at conf_lex.c:5174
#4 0x0804898a in confparse () at conf_yacc.c:1215
#5 0x0804bafc in commandconf (mode=68 'D',
line=0x80e9ee6 "@@include ") at commandconf.c:165
#6 0x08054832 in main (argc=67, argv=0xbffff004) at
aide.c:417
#7 0x08073a17 in __libc_start_main ()

The cause is I believe in commandconf.c and is in the
logic for handling the --check-config case. It
basically skips the initialisation section
---- Snip line 208
if((key=get_conf_key())!=NULL){
keylen=get_conf_key_len();

if( (conf->confmd=
mhash_hmac_init(conf->confhmactype,
key,
keylen,

mhash_get_hash_pblock(conf->confhmactype)))
------- End Snip

Basically the key is null so no initialisation of mhash
is skipped so conf->confmd the handle to mhash is null
- next stop bang! on line 229:

mhash(conf->confmd,(void*)buf,tmp-buf);

when mhash is called with confmd null.

I do not have a fix for this, I am only just begining
to understand it, what I can say is that is does not
affect the other commands to initialise, update and
check. So just aviod running aide --config-check.

keith.mcalisterATlogicacmg.com

Discussion

    • assigned_to: nobody --> rvdb
    • status: open --> closed-duplicate
     
  • Logged In: YES
    user_id=330646

    Duplicate of bug 851671. Fixed in CVS.