plane hacking
[oweals/gnunet.git] / src / fs / fs_file_information.c
index 1973e2bc163aa75dcc341ad87ed90c7df8136872..b9b5928dbce737cee3aabc5c4fb0a4d417660571 100644 (file)
@@ -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>",