]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
cmdmon: fix initialization of allocated reply slots
authorMiroslav Lichvar <mlichvar@redhat.com>
Wed, 24 Sep 2014 16:20:05 +0000 (18:20 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Thu, 25 Sep 2014 08:58:57 +0000 (10:58 +0200)
The next pointer in the last allocated reply slot was not set. This
could cause a crash when more slots were needed. (the slots are used to
save unacknowledged replies to authenticated commands)

cmdmon.c

index 020aa26d26ec77e7eb13806a92a8679a39678e4c..8406087ca06e2e15a2d32bbf81fa2317576e4342 100644 (file)
--- a/cmdmon.c
+++ b/cmdmon.c
@@ -566,6 +566,7 @@ get_more_replies(void)
     for (i=1; i<REPLY_EXTEND_QUANTUM; i++) {
       new_replies[i-1].next = new_replies + i;
     }
+    new_replies[REPLY_EXTEND_QUANTUM - 1].next = NULL;
     free_replies = new_replies;
   }
 }