Package: dialog
Version: 1.0-20051005-1
Severity: important
Tags: patch

Hi,

I've problems using libdialog.a with dynamic buffers.
eg. setting dialog_vars.input_result = NULL as requestet...

1. problem with dynamic buffers:
util.c:1528: void dlg_add_result(char *string)
  unsigned have = strlen(dialog_vars.input_result);
but input_result=NULL, so there is a nice segfault (addresse 0x0).

2. problem:
imho there is also a problem with fixed buffers under special
circumstances
util.c:1542 void dlg_add_result(char *string)
  dialog_vars.input_result =
  realloc(dialog_vars.input_result, dialog_vars.input_length);
but input_result is a static buffer on the stack, no one should
realloc such a thing ;).
there is also a mem-leak in this line if the realloc fails.
Because if realloc fails input_result will be overwritten with NULL
from realloc.
  
3. i've written a small patch to enhance usability of libdialog.
i've introduced a functionpointer void(*)(char*) in dialog_vars.
dlg_add_result it if it is not null and returns.

This small patch greatly enhances the usability of libdialog if the
program has to deal with the userinput.

Thx,
Michael Gebetsroither

-- System Information:
Debian Release: testing/unstable
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.12
Locale: LANG=en_US.iso885915, LC_CTYPE=en_US.iso885915 (charmap=ISO-8859-15)

Versions of packages dialog depends on:
ii  debianutils                   2.15       Miscellaneous utilities specific t
ii  libc6                         2.3.5-7    GNU C Library: Shared libraries an
ii  libncursesw5                  5.5-1      Shared libraries for terminal hand

dialog recommends no packages.

-- debconf-show failed
-- 
/*The only secure computer is one that's unplugged, locked in a
safe, and buried 20 feet under the ground in a secret location...
and i'm not even too sure about that one.*/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to