mc burn patch, version 0.2

Roland Illig roland.illig at gmx.de
Fri Nov 19 11:45:56 UTC 2004


Bart Friederichs wrote:
> A few years ago (2001) I wrote a patch to enable cd-writing in mc. I got 
> an email from Andy Shevchenko, with some additions to it.. It now 
> patches mc-4.6.1-pre1 and the saving of settings works.
> 
> Attached the patch for mcburn 0.2

I will not commit this patch, and I hope noone else will do. It contains 
a really large number of bugs:

* buffer overflows (e.g. in line 192)
* possible NullPointerExceptions (e.g. in line 116)
* memory leaks (e.g in line 668, 695)

Some minor issues are:
* Some strings are not translated properly.
* You should declare your functions as
   "void foo(void)" instead of "void foo()".
* Don't use C++ comments in C.
* instead of malloc/strcpy please use either
   concat_dir_and_file or g_strconcat.
* Always check the results of calls to the functions fgets, fscanf.
* After allocating a string, free it in the same function if possible.
* Replace the comment in lines 628--632 with a one line comment like:
   /**** MC-Burn configfile functions ****/
   It's visible enough.

Please first fix these bugs first, and then retry.

Roland



More information about the mc-devel mailing list