plane hacking
[oweals/gnunet.git] / src / fs / fs_file_information.c
index 2e9b7b6678426e86ff9df19dc12f6b433ee0bae2..b9b5928dbce737cee3aabc5c4fb0a4d417660571 100644 (file)
@@ -4,7 +4,7 @@
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -181,6 +181,8 @@ GNUNET_FS_file_information_create_from_file (struct GNUNET_FS_Handle *h,
                                                       anonymity,
                                                       priority,
                                                       expirationTime);
+  if (ret == NULL)
+    return NULL;
   ret->h = h;
   ret->filename = GNUNET_strdup (filename);
   fn = filename;
@@ -612,8 +614,9 @@ GNUNET_FS_file_information_create_from_directory (struct GNUNET_FS_Handle *h,
       dc.entries = dc.entries->next;
     }
   fn = filename;
-  while (NULL != (ss = strstr (fn,
-                              DIR_SEPARATOR_STR)))
+  while ( (NULL != (ss = strstr (fn,
+                                DIR_SEPARATOR_STR))) &&
+         (strlen (ss) > 1) )
     fn = ss + 1;
   GNUNET_CONTAINER_meta_data_insert (ret->meta,
                                     "<gnunet>",