OSDN Git Service

* options.c (gfc_handle_module_path_options): Fix buffer overrun.
[pf3gnuchains/gcc-fork.git] / gcc / fortran / options.c
index 5fb8740..f0135bd 100644 (file)
@@ -155,7 +155,7 @@ gfc_handle_module_path_options (const char *arg)
       exit (3);
     }
 
-  gfc_option.module_dir = (char *) gfc_getmem (strlen (arg));
+  gfc_option.module_dir = (char *) gfc_getmem (strlen (arg) + 2);
   strcpy (gfc_option.module_dir, arg);
   strcat (gfc_option.module_dir, "/");
 }