Off by one error in umid.c
Here's a fix for a little memory corruption I was having. I was passing in a uml_dir directory without a trailing slash.
Cheers,
- Jim
arch/um/kernel/umid.c +1 -1
@@ -200,7 +200,7 @@static int __init set_uml_dir (char *name,int *add) {if ((strlen (name) >0 ) && (name[strlen (name) -1 ] !='/' )){ - uml_dir =malloc (strlen (name) +1 ); + uml_dir =malloc (strlen (name) +2 );if (uml_dir ==NULL ){printf ("Failed to malloc uml_dir - error = %d\n" , errno);
arch/um/kernel/umid.c +1 -1
@@ -200,7 +200,7 @@static int __init set_uml_dir (char *name,int *add) {if ((strlen (name) >0 ) && (name[strlen (name) -1 ] !='/' )){ - uml_dir =malloc (strlen (name) +1 ); + uml_dir =malloc (strlen (name) +2 );if (uml_dir ==NULL ){printf ("Failed to malloc uml_dir - error = %d\n" , errno);
Quoted 2 lines · [email protected] said:
Here's a fix for a little memory corruption I was having. I was passing in a
uml_dirdirectory without a trailing slash.
Nice spotting.
Jeff
-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=4721&alloc_id=10040&op=click
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel