libs/wine/debug: Avoid over-allocating memory in default_dbgstr_wn.

Michael Karcher wine at mkarcher.dialup.fu-berlin.de
Wed Jul 16 03:47:34 CDT 2008


Am Dienstag, den 15.07.2008, 15:55 -0700 schrieb Dan Hipschman:
>      if (n < 0) n = 0;
>      size = 12 + min( 300, n * 5 );
> -    dst = res = funcs.get_temp_buffer( n * 5 + 7 );
> +    dst = res = funcs.get_temp_buffer( size );
This looks like fixing an under-allocation, not over-allocation. The
patched code allocates at least 5 bytes more, and never less than 312.

Regards,
  Michael Karcher




More information about the wine-devel mailing list