Skip to content

Commit

Permalink
update tinydir.h to newest version (1.2.6)
Browse files Browse the repository at this point in the history
Update to cxong/tinydir version 1.2.6 commit 8124807 ("Fix buffer overflow in tinydir_file_open with long path names")

Although we're not affected of this bug, prevent others copying from our repo being affected...
  • Loading branch information
goldsimon committed Jan 4, 2024
1 parent b413b04 commit 0918866
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions src/apps/http/makefsdata/tinydir.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
Copyright (c) 2013-2019, tinydir authors:
Copyright (c) 2013-2021, tinydir authors:
- Cong Xu
- Lautis Sun
- Baudouin Feildel
Expand Down Expand Up @@ -125,8 +125,13 @@ extern "C" {
# define _TINYDIR_FUNC static __inline
#elif !defined __STDC_VERSION__ || __STDC_VERSION__ < 199901L
# define _TINYDIR_FUNC static __inline__
#else
#elif defined(__cplusplus)
# define _TINYDIR_FUNC static inline
#elif defined(__GNUC__)
/* Suppress unused function warning */
# define _TINYDIR_FUNC __attribute__((unused)) static
#else
# define _TINYDIR_FUNC static
#endif

/* readdir_r usage; define TINYDIR_USE_READDIR_R to use it (if supported) */
Expand Down Expand Up @@ -543,7 +548,9 @@ int tinydir_readfile(const tinydir_dir *dir, tinydir_file *file)
if (_tstat(
#elif (defined _BSD_SOURCE) || (defined _DEFAULT_SOURCE) \
|| ((defined _XOPEN_SOURCE) && (_XOPEN_SOURCE >= 500)) \
|| ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L))
|| ((defined _POSIX_C_SOURCE) && (_POSIX_C_SOURCE >= 200112L)) \
|| ((defined __APPLE__) && (defined __MACH__)) \
|| (defined BSD)
if (lstat(
#else
if (stat(
Expand Down Expand Up @@ -636,7 +643,7 @@ int tinydir_file_open(tinydir_file *file, const _tinydir_char_t *path)
int result = 0;
int found = 0;
_tinydir_char_t dir_name_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t file_name_buf[_TINYDIR_FILENAME_MAX];
_tinydir_char_t file_name_buf[_TINYDIR_PATH_MAX];
_tinydir_char_t *dir_name;
_tinydir_char_t *base_name;
#if (defined _MSC_VER || defined __MINGW32__)
Expand Down

0 comments on commit 0918866

Please sign in to comment.