* pinfo.cc (commune_process): Fix randomly invalid pointer which caused fifos

to work incorrectly.
This commit is contained in:
Christopher Faylor 2006-03-20 01:59:23 +00:00
parent 7d85b417f1
commit c5c3d69d8a
3 changed files with 16 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2006-03-19 Christopher Faylor <cgf@timesys.com>
* pinfo.cc (commune_process): Fix randomly invalid pointer which caused
fifos to work incorrectly.
2006-03-19 Christopher Faylor <cgf@timesys.com>
* dcrt0.cc (dll_crt0_0): Oops. We need to bother with setting this in

View File

@ -402,6 +402,8 @@ commune_process (void *arg)
ProtectHandle (process_sync);
lock_process now (false);
if (si._si_commune._si_code & PICOM_EXTRASTR)
si._si_commune._si_str = (char *) (&si + 1);
switch (si._si_commune._si_code)
{
@ -524,7 +526,7 @@ commune_process (void *arg)
}
case PICOM_FIFO:
{
sigproc_printf ("processing PICOM_FIFO");
sigproc_printf ("processing PICOM_FIFO for %s", si._si_commune._si_str);
fhandler_fifo *fh = cygheap->fdtab.find_fifo (si._si_commune._si_str);
HANDLE it[2];
if (fh == NULL)

View File

@ -679,10 +679,14 @@ sig_send (_pinfo *p, siginfo_t& si, _cygtls *tls)
else
{
size_t n = strlen (si._si_commune._si_str);
char *p = leader = (char *) alloca (sizeof (pack) + sizeof (n) + n);
memcpy (p, &pack, sizeof (pack)); p += sizeof (pack);
memcpy (p, &n, sizeof (n)); p += sizeof (n);
memcpy (p, si._si_commune._si_str, n); p += n;
char *p = leader = (char *) alloca (sizeof (pack) + sizeof (n) + n /*DELETEME*/ + 1);
memcpy (p, &pack, sizeof (pack));
p += sizeof (pack);
memcpy (p, &n, sizeof (n));
p += sizeof (n);
memcpy (p, si._si_commune._si_str, n);
p[n] = '\0'; sigproc_printf ("n %d, si_str %s", n, p);
p += n;
packsize = p - leader;
}