Good day.

Had tried to run Maui on CentOS 5.0/x86_64 and faced the same error
that was reported by Earle Nietzel almost a year ago,
http://www.clusterresources.com/pipermail/mauiusers/2006-November/002420.html

Tried the latest snapshot, but the problem is still there.  The patch
that enabled Maui to work is attached.  Could it be intergrated to
the next release (if it was not patched in the develpment sources)?

Thanks!
-- 
Eygene Ryabinkin, RRC KI
>From b3642b10bb441ce1b2155c5232199b7b9c736caf Mon Sep 17 00:00:00 2001
From: Eygene Ryabinkin <[EMAIL PROTECTED]>
Date: Wed, 21 Nov 2007 18:54:06 +0300
Subject: [PATCH] Fix improper use of snprintf arguments

As was found by Earle Nietzel [1], 'snprintf (TSLine, "%s %s", TSLine)'
provokes errors, since it is not defined if the space between two
'%s' strings will be first put to the 'TSLine' or one will note
that TSLine had ended with '\0'.  This code compiled on CentOS 5.0
x86_64 shows wrong behaviour.  32-bit systems seem to be unaffected
(in practice).

[1] http://www.clusterresources.com/pipermail/mauiusers/2006-November/002420.html

Signed-off-by: Eygene Ryabinkin <[EMAIL PROTECTED]>
---
 src/mcom/MSU.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/mcom/MSU.c b/src/mcom/MSU.c
index edc481c..465c8a3 100644
--- a/src/mcom/MSU.c
+++ b/src/mcom/MSU.c
@@ -1415,14 +1415,14 @@ int MSUSendData(
 
         if (S->Name[0] != '\0')
           {
-          sprintf(TSLine,"%s %s%s",
-            TSLine,
+          sprintf(TSLine + strlen(TSLine),
+            " %s%s",
             MCKeyword[mckClient],
             S->Name);
           }
 
-        sprintf(TSLine,"%s %s",
-          TSLine,
+        sprintf(TSLine + strlen(TSLine),
+          " %s",
           MCKeyword[mckData]);
         
         MSecGetChecksum2(
-- 
1.5.3.2

_______________________________________________
mauiusers mailing list
mauiusers@supercluster.org
http://www.supercluster.org/mailman/listinfo/mauiusers

Reply via email to