Bug Fix: added NULL checks for use of find_user
This commit is contained in:
parent
33b3c5b1e6
commit
6f88846f61
8 changed files with 22 additions and 0 deletions
|
@ -8,6 +8,7 @@ Shmad & ^Enigma^
|
|||
- Added ABOUT command (M)
|
||||
- Coloured output is now optional - see cs.c for details (M)
|
||||
- Changed to new Module API system removing need for __module_get_xxx() calls (M)
|
||||
- Added missing NULL checks for finduser results to avoid referencing NULL pointers (M)
|
||||
|
||||
* Version 1.7 * July 15th, 2003
|
||||
- Fixed a problem with connectserv clobering the avlist for modes
|
||||
|
|
|
@ -92,6 +92,8 @@ int __Bot_Message(char *origin, char **av, int ac)
|
|||
{
|
||||
User *u;
|
||||
u = finduser(origin);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!cs_online)
|
||||
return 1;
|
||||
|
@ -263,6 +265,8 @@ int cs_new_user(char **av, int ac)
|
|||
return 1;
|
||||
|
||||
u = finduser(av[0]);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
if (!strcasecmp(u->server->name, me.name)) {
|
||||
/* its me, forget it */
|
||||
return 1;
|
||||
|
@ -300,6 +304,8 @@ int cs_del_user(char **av, int ac)
|
|||
return 1;
|
||||
|
||||
u = finduser(av[0]);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!strcasecmp(u->server->name, me.name)) {
|
||||
/* its me, forget it */
|
||||
|
@ -853,6 +859,8 @@ int cs_user_kill(char **av, int ac)
|
|||
return 1;
|
||||
|
||||
u = finduser(av[0]);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!strcasecmp(u->server->name, me.name)) {
|
||||
/* its me, forget it */
|
||||
|
|
|
@ -9,6 +9,7 @@ Shmad <shmad@neostats.net>
|
|||
- Added ABOUT command (M)
|
||||
- Undernet Style Hidden Hosts for registered nicknames is now supported! (F)
|
||||
- Changed to use new module export API (M)
|
||||
- Added missing NULL checks for finduser results to avoid referencing NULL pointers (M)
|
||||
|
||||
* Version 2.7.1 * Shmad * May 11th, 2003
|
||||
- Fixed a nasty seg bug *smacks fish* we don't free(s_HostServ);
|
||||
|
|
|
@ -146,6 +146,8 @@ int del_moddata(char **av, int ac) {
|
|||
|
||||
User *u;
|
||||
u = finduser(av[0]);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
if (u->moddata[hs_cfg.modnum]) {
|
||||
nlog(LOG_DEBUG2, LOG_MOD, "Freeing Module data");
|
||||
free(u->moddata[hs_cfg.modnum]);
|
||||
|
@ -284,6 +286,8 @@ int __Bot_Message(char *origin, char **av, int ac)
|
|||
int t = 0;
|
||||
User *u;
|
||||
u = finduser(origin);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!strcasecmp(av[1], "HELP")) {
|
||||
if (ac <= 2) {
|
||||
|
@ -686,6 +690,8 @@ int hs_mode(char **av, int ac) {
|
|||
/* first, find if its a regnick mode */
|
||||
if (index(av[1], 'r')) {
|
||||
u = finduser(av[0]);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
if (u->moddata[hs_cfg.modnum] != NULL) {
|
||||
nlog(LOG_DEBUG2, LOG_MOD, "not setting hidden host on %s", av[0]);
|
||||
return -1;
|
||||
|
|
|
@ -5,6 +5,7 @@ Author: Shmad <shmad@neostats.net>
|
|||
- Help text cleanup (M)
|
||||
- Added ABOUT command (M)
|
||||
- Changed to use new module export API (M)
|
||||
- Added missing NULL checks for finduser results to avoid referencing NULL pointers (M)
|
||||
|
||||
* Version 1.7 * April 17th, 2003
|
||||
- Updated with new Logging functions
|
||||
|
|
|
@ -78,6 +78,8 @@ int __Bot_Message(char *origin, char **av, int ac)
|
|||
User *u;
|
||||
char *cmd;
|
||||
u = finduser(origin);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!strcasecmp(av[1], "HELP")) {
|
||||
if (ac <= 2) {
|
||||
|
|
|
@ -4,6 +4,7 @@ MoraleServ ChangeLog - Anything we add/remove/fix/change is in here (even our ra
|
|||
- Help text cleanup (M)
|
||||
- Added ABOUT command (M)
|
||||
- Changed to use new module export API (M)
|
||||
- Added missing NULL checks for finduser results to avoid referencing NULL pointers (M)
|
||||
|
||||
* MoraleServ * Fish * Version 2.20
|
||||
- Moved to new Logging Functions
|
||||
|
|
|
@ -73,6 +73,8 @@ int __Bot_Message(char *origin, char **av, int ac)
|
|||
{
|
||||
User *u;
|
||||
u = finduser(origin);
|
||||
if (!u) /* User not found */
|
||||
return 1;
|
||||
|
||||
if (!strcasecmp(av[1], "HELP")) {
|
||||
if (ac <= 2) {
|
||||
|
|
Reference in a new issue