On 5/11/06, [email protected]
<[email protected]> wrote:
linux-ha CVS committal

Author  : lars
Host    :
Project : linux-ha
Module  : heartbeat

Dir     : linux-ha/heartbeat


Modified Files:
        heartbeat.c


Log Message:
Coverity #42: Static buffer overrun in our re-transit code!

===================================================================
RCS file: /home/cvs/linux-ha/linux-ha/heartbeat/heartbeat.c,v
retrieving revision 1.506
retrieving revision 1.507
diff -u -3 -r1.506 -r1.507
--- heartbeat.c 26 Apr 2006 03:42:07 -0000      1.506
+++ heartbeat.c 11 May 2006 07:41:01 -0000      1.507
@@ -1,4 +1,4 @@
-/* $Id: heartbeat.c,v 1.506 2006/04/26 03:42:07 alan Exp $ */
+/* $Id: heartbeat.c,v 1.507 2006/05/11 07:41:01 lars Exp $ */
 /*
  * heartbeat: Linux-HA heartbeat code
  *
@@ -1486,12 +1486,16 @@
        ,       hb_send_local_status, NULL, NULL);
        G_main_setall_id(id, "send local status", 10+config->heartbeat_ms/2, 
50);

-       id=Gmain_timeout_add_full(PRI_AUDITCLIENT
-       ,       config->initial_deadtime_ms
-       ,       set_init_deadtime_passed_flag
-       ,       NULL
-       ,       NULL);
-       G_main_setall_id(id, "init deadtime passed", config->warntime_ms, 50);
+       if (DoManageResources == TRUE) {
+               id=Gmain_timeout_add_full(PRI_AUDITCLIENT
+               ,       config->initial_deadtime_ms
+               ,       set_init_deadtime_passed_flag
+               ,       NULL
+               ,       NULL);
+               G_main_setall_id(id, "init deadtime passed", 
config->warntime_ms, 50);
+       } else {
+               set_init_deadtime_passed_flag(NULL);
+       }

        /* Dump out memory stats periodically... */
        memstatsinterval = (debug_level ? 10*60*1000 : ONEDAY*1000);
@@ -5976,7 +5980,7 @@
                        size_t          len;

                        if (msgslot < 0) {

perhaps this condition should also include: msgslot >= MAXMSGHIST  ?

-                               msgslot = MAXMSGHIST;
+                               msgslot = MAXMSGHIST-1;
                        }
                        if (hist->msgq[msgslot] == NULL) {
                                continue;
@@ -6282,6 +6286,9 @@

 /*
  * $Log: heartbeat.c,v $
+ * Revision 1.507  2006/05/11 07:41:01  lars
+ * Coverity #42: Static buffer overrun in our re-transit code!
+ *
  * Revision 1.506  2006/04/26 03:42:07  alan
  * Committed a patch from gshi which should GREATLY improve the
  * behavior of autojoin code.


_______________________________________________
Linux-ha-cvs mailing list
[email protected]
http://lists.community.tummy.com/mailman/listinfo/linux-ha-cvs

_______________________________________________________
Linux-HA-Dev: [email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha-dev
Home Page: http://linux-ha.org/

Reply via email to