diff options
author | Edward Thomson <ethomson@microsoft.com> | 2013-08-08 11:05:00 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2013-08-08 12:32:23 -0500 |
commit | 57f31f058c29edfd7d6d810fcd4a964875e9d463 (patch) | |
tree | 382c686e0418eb707ea6d5ce9b7fe02ead03965e /src/posix.h | |
parent | 5e96f31638fe71a0c76805b1352f437881791d98 (diff) | |
download | libgit2-57f31f058c29edfd7d6d810fcd4a964875e9d463.tar.gz |
Fixes to safely reading the index
Avoid wrapping around extension size when reading, avoid walking off
the end of the buffer when reading names.
Diffstat (limited to 'src/posix.h')
-rw-r--r-- | src/posix.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/posix.h b/src/posix.h index 40bcc1ab0..ea97a1349 100644 --- a/src/posix.h +++ b/src/posix.h @@ -93,6 +93,10 @@ extern int p_gettimeofday(struct timeval *tv, struct timezone *tz); # include "unix/posix.h" #endif +#ifndef __MINGW32__ +# define p_strnlen strnlen +#endif + #ifdef NO_READDIR_R # include <dirent.h> GIT_INLINE(int) p_readdir_r(DIR *dirp, struct dirent *entry, struct dirent **result) |