Committer : klmitch
CVSROOT : /cvsroot/undernet-ircu
Module : ircu2.10
Branch tags: u2_10_12_branch
Commit time: 2006-02-22 15:18:50 UTC
Modified files:
Tag: u2_10_12_branch
ChangeLog ircd/s_auth.c
Log message:
Author: Kev <[EMAIL PROTECTED]>
Log message:
Stomp a crash bug when no iauthd is configured
---------------------- diff included ----------------------
Index: ircu2.10/ChangeLog
diff -u ircu2.10/ChangeLog:1.710.2.73 ircu2.10/ChangeLog:1.710.2.74
--- ircu2.10/ChangeLog:1.710.2.73 Fri Feb 17 02:34:59 2006
+++ ircu2.10/ChangeLog Wed Feb 22 07:18:39 2006
@@ -1,3 +1,8 @@
+2006-02-22 Kevin L. Mitchell <[EMAIL PROTECTED]>
+
+ * ircd/s_auth.c: fix macros to not dereference a NULL pointer when
+ iauth is not connected
+
2006-02-17 Alex Badea <[EMAIL PROTECTED]>
* ircd/s_auth.c (auth_set_username): Check if the last
Index: ircu2.10/ircd/s_auth.c
diff -u ircu2.10/ircd/s_auth.c:1.37.2.2 ircu2.10/ircd/s_auth.c:1.37.2.3
--- ircu2.10/ircd/s_auth.c:1.37.2.2 Fri Feb 17 02:34:59 2006
+++ ircu2.10/ircd/s_auth.c Wed Feb 22 07:18:39 2006
@@ -31,7 +31,7 @@
*/
/** @file
* @brief Implementation of DNS and ident lookups.
- * @version $Id: s_auth.c,v 1.37.2.2 2006/02/17 10:34:59 decampos Exp $
+ * @version $Id: s_auth.c,v 1.37.2.3 2006/02/22 15:18:39 klmitch Exp $
*/
#include "config.h"
@@ -178,13 +178,13 @@
};
/** Return whether flag \a flag is set on \a iauth. */
-#define IAuthHas(iauth, flag) FlagHas(&iauth->i_flags, flag)
+#define IAuthHas(iauth, flag) ((iauth) && FlagHas(&(iauth)->i_flags, flag))
/** Set flag \a flag on \a iauth. */
-#define IAuthSet(iauth, flag) FlagSet(&iauth->i_flags, flag)
+#define IAuthSet(iauth, flag) FlagSet(&(iauth)->i_flags, flag)
/** Clear flag \a flag from \a iauth. */
-#define IAuthClr(iauth, flag) FlagClr(&iauth->i_flags, flag)
+#define IAuthClr(iauth, flag) FlagClr(&(iauth)->i_flags, flag)
/** Get connected flag for \a iauth. */
-#define i_GetConnected(iauth) (s_fd(i_socket(iauth)) > -1)
+#define i_GetConnected(iauth) ((iauth) && s_fd(i_socket(iauth)) > -1)
/** Return socket event generator for \a iauth. */
#define i_socket(iauth) (&(iauth)->i_socket)
@@ -193,7 +193,7 @@
/** Return outbound message queue for \a iauth. */
#define i_sendQ(iauth) (&(iauth)->i_sendQ)
/** Return debug level for \a iauth. */
-#define i_debug(iauth) (iauth->i_debug)
+#define i_debug(iauth) ((iauth)->i_debug)
/** Active instance of IAuth. */
struct IAuth *iauth;
----------------------- End of diff -----------------------
_______________________________________________
Patches mailing list
[email protected]
http://undernet.sbg.org/mailman/listinfo/patches