Explorar el Código

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 hace 12 años
padre
commit
60636cdbd5
Se han modificado 1 ficheros con 4 adiciones y 0 borrados
  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) {