fixing common off-by-one error with respect to maximum message size
[oweals/gnunet.git] / src / fs / fs_publish.c
index 2ebb96169c5933855d18be38bfc3b332cc1b293c..13701405ec7f4fa224c0342c0e22a275accde33e 100644 (file)
@@ -761,7 +761,7 @@ hash_for_index_cb (void *cls,
   fn = GNUNET_STRINGS_filename_expand (p->filename);
   GNUNET_assert (fn != NULL);
   slen = strlen (fn) + 1;
-  if (slen > GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof(struct IndexStartMessage))
+  if (slen >= GNUNET_SERVER_MAX_MESSAGE_SIZE - sizeof(struct IndexStartMessage))
     {
       GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
                  _("Can not index file `%s': %s.  Will try to insert instead.\n"),