fs/cromfs and tools/gencromfs: Various fixes for traversal relative file paths. Biggest changes is in types used: Cannot use size_t or mode_t in common structures because they have different sizes on the (64-bit) host and the (32-bit) target. Use uint32_t instead of size_t for offsets. Use uint16_t instead of mode_t.

This commit is contained in:
Gregory Nutt
2018-03-20 12:37:01 -06:00
parent 87fd4e2916
commit 22484386ee
5 changed files with 109 additions and 82 deletions
+2 -2
View File
@@ -108,8 +108,8 @@ struct fs_romfsdir_s
struct fs_cromfsdir_s
{
off_t cr_firstoffset; /* Offset to the first entry in the directory */
off_t cr_curroffset; /* Current offset into the directory contents */
uint32_t cr_firstoffset; /* Offset to the first entry in the directory */
uint32_t cr_curroffset; /* Current offset into the directory contents */
};
#endif /* CONFIG_FS_CROMFS */
+7 -7
View File
@@ -111,20 +111,20 @@
/* Floating point types */
typedef float float32;
typedef float float32;
#ifndef CONFIG_HAVE_DOUBLE
typedef float double_t;
typedef float float64;
typedef float double_t;
typedef float float64;
#else
typedef double double_t;
typedef double float64;
typedef double double_t;
typedef double float64;
#endif
/* Misc. scalar types */
/* mode_t is an integer type used for file attributes. mode_t needs
* to be at least 16-bits but, in fact must be sizeof(int) because it is
* pased via varargs.
* to be at least 16-bits but, in fact, must be sizeof(int) because it is
* passed via varargs.
*/
typedef unsigned int mode_t;