logo

oasis

Own branch of Oasis Linux (upstream: <https://git.sr.ht/~mcf/oasis/>) git clone https://anongit.hacktivis.me/git/oasis.git

0008-Use-alloca-when-VLAs-aren-t-available.patch (824B)


  1. From 4673bf0d6a0eba5d363266a40cfb087e08a66e7f Mon Sep 17 00:00:00 2001
  2. From: Michael Forney <mforney@mforney.org>
  3. Date: Thu, 30 Jan 2020 21:57:34 -0800
  4. Subject: [PATCH] Use alloca when VLAs aren't available
  5. ---
  6. src/evdev.c | 6 +++++-
  7. 1 file changed, 5 insertions(+), 1 deletion(-)
  8. diff --git a/src/evdev.c b/src/evdev.c
  9. index 81dd951cb..74a765469 100644
  10. --- a/src/evdev.c
  11. +++ b/src/evdev.c
  12. @@ -164,9 +164,13 @@ decode_bitset(struct tcb *const tcp, const kernel_ulong_t arg,
  13. return RVAL_IOCTL_DECODED;
  14. }
  15. +#ifndef __STDC_NO_VLA__
  16. char decoded_arg[size];
  17. +#else
  18. + char *decoded_arg = alloca(size);
  19. +#endif
  20. - if (umove_or_printaddr(tcp, arg, &decoded_arg))
  21. + if (umoven_or_printaddr(tcp, arg, size, decoded_arg))
  22. return RVAL_IOCTL_DECODED;
  23. if (xlat_verbose(xlat_verbosity) != XLAT_STYLE_RAW) {
  24. --
  25. 2.34.1