Ver código fonte

inode 0 is invalid: don't try to match it from a DB

Otherwise, a new file with an invalid inode is considered like a rename
of another file with an invalid inode
Olivier Goffart 12 anos atrás
pai
commit
60636cdbd5
1 arquivos alterados com 4 adições e 0 exclusões
  1. 4 0
      src/csync_statedb.c

+ 4 - 0
src/csync_statedb.c

@@ -482,6 +482,10 @@ csync_file_stat_t *csync_statedb_get_stat_by_inode(sqlite3 *db,
   char *stmt = NULL;
   size_t len = 0;
 
+  if (!inode) {
+      return NULL;
+  }
+
   stmt = sqlite3_mprintf("SELECT * FROM metadata WHERE inode='%lld'",
              (long long signed int) inode);
   if (stmt == NULL) {