Fix potentially dangerous uses of mkpath and git_path
[gitweb.git] / cache.h
diff --git a/cache.h b/cache.h
index cdbeb48c65f45b4b37ceb767a72866e5a7475cc3..629cdf3971f0e55fc34b7b5f43e5b4ea225e5be4 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -495,6 +495,9 @@ extern int check_repository_format(void);
 #define DATA_CHANGED    0x0020
 #define TYPE_CHANGED    0x0040
 
+extern char *mksnpath(char *buf, size_t n, const char *fmt, ...)
+       __attribute__((format (printf, 3, 4)));
+
 /* Return a statically allocated filename matching the sha1 signature */
 extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
 extern char *git_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
@@ -519,6 +522,7 @@ static inline void hashclr(unsigned char *hash)
 {
        memset(hash, 0, 20);
 }
+extern int is_empty_blob_sha1(const unsigned char *sha1);
 
 int git_mkstemp(char *path, size_t n, const char *template);