EnergyMech

Forum | Features | Download | Addons | Help | #emech | Links | About | Contact

Versions | News Archive | Installing | Linking | Configuration | Commands | FAQ


The time is now Saturday, November 18th, 2017, 10:22am

Create account ]   User/Pass   


Forum Index :: Bug Reports :: CMD user + make bot crash :: Reply to this topic

Author
 
stali0n
Posted :: 8:01pm, Tue, Oct 20, 2009     Subject :: CMD user + make bot crash


Posts: 1
 
    Everytime i do a user + cmd it make my bots crash... but with the file trick.conf it works fine ... so i can start the bot and be owner but after that when i want to add user into the bot it make it crash see at the debug info ... not very usefull i think but take a look at it. the result is the via dcc or msg or public cmd ... i try to put a regular user and that's the same, even if i try to force the password.

(in) {5} :stali0n!acura@si.tu.es.perdu.c-est.que.ta.pas.pris.la.bonne.route.info PRIVMSG #ircu :user + Perl * *!*acura@*.ircu.biz 200 t8t8t8
(send_spy) src status format = ':%s[%i]: Executing %s[%i]'
(add_user) handle = Perl; pass = <NULL>; axs = 200
(sigsegv)
(uptime_death) sending death message
(signoff) Saving lists...
(delete_vars) deleting string var `STATS'
(delete_vars) deleting string var `ENFMODES'
(delete_vars) deleting string var `DYNLIMIT'
(delete_vars) all done
[StS] {5} QUIT :Mary had a little signal segmentation fault (SIGSEGV)
(killsock) {5} added killsocket
(delete_vars) deleting string var `WINGATE'
(delete_vars) deleting string var `VIRTUAL'
(delete_vars) deleting string var `USERFILE'
(delete_vars) deleting string var `UMODES'
(delete_vars) deleting string var `SERVERGROUP'
(delete_vars) deleting string var `NOTIFYFILE'
(delete_vars) deleting string var `IRCNAME'
(delete_vars) deleting string var `IDENT'
(delete_vars) deleting string var `DCCFILES'
(delete_vars) deleting string var `ALTNICK'
(delete_vars) deleting string var `STATS'
(delete_vars) deleting string var `ENFMODES'
(delete_vars) deleting string var `DYNLIMIT'
(delete_vars) all done
(signoff) Removing userlist...
(signoff) Removing lastcmd list...
(signoff) Unlinking bot record from linked list...
(uptime_death) sending death message
(killsock) {5} removing killsocket
execve( ./energymech, argv = { ./energymech 1 <NULL> <NULL> <NULL> <NULL> }, envp = { <NULL> } )
EnergyMech 3.0.99p3, July 24th, 2009
Compiled on Sep 22 2009 16:29:29
Features: alias, bounce, chanban, debug, dyn, md5, net, newbie, rawdns, session, telnet
init: Restoring previously saved session...
init: Mech(s) added [ Gnu ]
init: EnergyMech running...

thk for you help

 
stali0n
Posted :: 3:00pm, Tue, Nov 3, 2009     Subject :: CMD user + make bot crash


Posts: 1
 
    Is there any solution for that ?? or will I have to wait for the next release ?

 
Agonizer2
Posted :: 10:56am, Sat, Nov 21, 2009

(anonymous)
 
    Problem seems to be an empty password of course:

(user.c):
User *add_user(char *handle, char *pass, int axs)
{
...
user = (User*)Calloc(sizeof(User) + Strlen2(handle,pass));

(function.c):
int Strlen2(const char *one, const char *two)
{
const char *s1,*s2;

for(s1=one;*s1;s1++);
for(s2=two;*s2;s2++);
return((s1 - one) + (s2 - two));
}

Strlen2 is not checking for nullpointers, accessing contents of *(null) will mostly fail.

i suggest
int Strlen2(const char *one, const char *two)
{
const char *s1,*s2;

if ((s1=one))
while (*s1) s1++;
if ((s2=two))
while (*s2) s2++;
return((s1 - one) + (s2 - two));
}

or

int Strlen2(const char *one, const char *two)
{
int s = 0;

if (one)
while (*one++) s++;
if (two)
while (*two++) s++;
return (s);
}

This is untested and i may be wrong.


 

Copyright © 2000-2005 Proton,  All rights reserved. Last edited August 16th, 2005.
HTML 4.01 CSS