> I would suggest the following patch for kernel 2036 (stable) -->

> --- kernel/memmgr.old   2006-08-18 10:22:33.000000000 +0200
> +++ kernel/memmgr.c     2006-08-18 10:22:33.000000000 +0200
> @@ -66,7 +66,12 @@
>       /* join both MCBs */
>       p->m_type = q->m_type;      /* possibly the next MCB is the last one
> */
>       p->m_size += q->m_size + 1; /* one for q's MCB itself */
> +#if 0                          /* this disturbs QB 4.x  double-free... */
>       q->m_type = 'K';            /* Invalidate the magic number */
> +#else
+    q->>m_type = MCB_NORMAL;    /* make QB 4.x happy... */
+    q->>m_psp = FREE_PSP;       /* leave MCB as "valid but free" */
> +#endif
>     }

     q->>m_type = MCB_NORMAL;    /* make QB 4.x happy... */
is not a good idea (could also be MCB_LAST). just leave it as it is

     q->>m_psp = FREE_PSP;       /* leave MCB as "valid but free" */
is necessary (it's already free)

leaving
       p->m_size += q->m_size + 1; /* one for q's MCB itself */
 +#if 0                          /* this disturbs QB 4.x  double-free... */
       q->m_type = 'K';            /* Invalidate the magic number */
 +#endif

as the patch I'd recommend

OTOH, now imagine a program

   memptr = dos_alloc(100);

   dos_free(memptr);

   mem2 = dosalloc(10);

   dos_resize(memptr,200);  /* which will ALSO take ownership of THIS
                               block !! */
   
   ...

you can crash the DOS MCB-list in amazing interesting ways, just by
dos_resize() and dos_free() with freed MCBs


with
       q->m_type = 'K';            /* Invalidate the magic number */

you have a good chance to catch this (all bad calls fail)


so IMHO in general your patch is  not a good idea to do.
but of course you could have a kernel_config option

   sys config BRUN40_COMPATIBLE=1
   
Tom












 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Freedos-devel mailing list
Freedos-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to