Staging
v0.5.2
https://github.com/git/git
Revision 6490a3383f1d0d96c122069e510ef1af1d019fbb authored by Junio C Hamano on 02 August 2007, 22:10:56 UTC, committed by Junio C Hamano on 03 August 2007, 00:26:26 UTC
In set_work_tree(), variable rel needs to be reinitialized to
NULL on every call (it should not be static).

Make sure the incoming dir variable is not too long before
copying to the temporary buffer, and make sure chdir to the
resulting directory succeeds.

This was spotted and fixed by Alex and Johannes in a handful
patch exchanges.  Here is the final version.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
Acked-by: Johannes Schindelin <Johannes.Schindelin@gmx.de>
1 parent 29093c2
Raw File
Tip revision: 6490a3383f1d0d96c122069e510ef1af1d019fbb authored by Junio C Hamano on 02 August 2007, 22:10:56 UTC
Fix work-tree related breakages
Tip revision: 6490a33
csum-file.h
#ifndef CSUM_FILE_H
#define CSUM_FILE_H

/* A SHA1-protected file */
struct sha1file {
	int fd, error;
	unsigned int offset, namelen;
	SHA_CTX ctx;
	char name[PATH_MAX];
	int do_crc;
	uint32_t crc32;
	unsigned char buffer[8192];
};

extern struct sha1file *sha1fd(int fd, const char *name);
extern int sha1close(struct sha1file *, unsigned char *, int);
extern int sha1write(struct sha1file *, void *, unsigned int);
extern void crc32_begin(struct sha1file *);
extern uint32_t crc32_end(struct sha1file *);

#endif
back to top