[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
MiG bug
From: |
Andreas Jonsson |
Subject: |
MiG bug |
Date: |
Thu, 18 Mar 2004 15:51:55 +0100 |
User-agent: |
Mutt/1.3.28i |
Hi,
I get a segfault in migcomm. Stdarg is used incorrectly in the
functions WriteCopyType and WritePackMsgType, as the contents of
`pvar' is undefined after the first call to vfprintf. Resetting it
between the calls fixes this problem.
Index: utils.c
===================================================================
RCS file: /cvsroot/hurd/mig/utils.c,v
retrieving revision 1.2
diff -u -r1.2 utils.c
--- utils.c 11 Feb 2004 01:42:14 -0000 1.2
+++ utils.c 18 Mar 2004 14:31:23 -0000
@@ -382,6 +382,8 @@
fprintf(file, "\t");
SkipVFPrintf(file, left, pvar);
fprintf(file, " = ");
+ va_end(pvar);
+ va_start(pvar, right);
SkipVFPrintf(file, right, pvar);
fprintf(file, ";\n");
}
@@ -390,6 +392,8 @@
fprintf(file, "\t(void) %smig_strncpy(", SubrPrefix);
SkipVFPrintf(file, left, pvar);
fprintf(file, ", ");
+ va_end(pvar);
+ va_start(pvar, right);
SkipVFPrintf(file, right, pvar);
fprintf(file, ", %d);\n", it->itTypeSize);
}
@@ -399,6 +403,8 @@
it->itTypeSize);
SkipVFPrintf(file, left, pvar);
fprintf(file, " = * (sp) ");
+ va_end(pvar);
+ va_start(pvar, right);
SkipVFPrintf(file, right, pvar);
fprintf(file, "; }\n");
}
@@ -416,6 +422,8 @@
fprintf(file, "\t");
SkipVFPrintf(file, left, pvar);
fprintf(file, " = ");
+ va_end(pvar);
+ va_start(pvar, right);
SkipVFPrintf(file, right, pvar);
fprintf(file, ";\n");
- MiG bug,
Andreas Jonsson <=