You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
1016 B

  1. diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
  2. index 14d7a797451..1982f128cb3 100644
  3. --- a/source3/modules/vfs_fruit.c
  4. +++ b/source3/modules/vfs_fruit.c
  5. @@ -119,6 +119,18 @@ static struct global_fruit_config {
  6. #define AFPRESOURCE_EA_NETATALK "user." NETATALK_RSRC_XATTR
  7. #endif
  8. +#ifndef OFF_T_MAX
  9. +#if SIZEOF_OFF_T == SIZEOF_INT8_T
  10. +#define OFF_T_MAX INT8_MAX
  11. +#elif SIZEOF_OFF_T == SIZEOF_INT16_T
  12. +#define OFF_T_MAX INT16_MAX
  13. +#elif SIZEOF_OFF_T == SIZEOF_INT32_T
  14. +#define OFF_T_MAX INT32_MAX
  15. +#elif SIZEOF_OFF_T == SIZEOF_INT64_T
  16. +#define OFF_T_MAX INT64_MAX
  17. +#endif
  18. +#endif
  19. +
  20. enum apple_fork {APPLE_FORK_DATA, APPLE_FORK_RSRC};
  21. enum fruit_rsrc {FRUIT_RSRC_STREAM, FRUIT_RSRC_ADFILE, FRUIT_RSRC_XATTR};
  22. @@ -6867,7 +6879,7 @@ static bool fruit_tmsize_do_dirent(vfs_handle_struct *handle,
  23. return true;
  24. }
  25. - if (bandsize > SIZE_MAX/nbands) {
  26. + if (bandsize > OFF_T_MAX/nbands) {
  27. DBG_ERR("tmsize overflow: bandsize [%zu] nbands [%zu]\n",
  28. bandsize, nbands);
  29. return false;