patch-cmd-string_c 622 B

123456789101112131415161718192021
  1. $OpenBSD: patch-cmd-string_c,v 1.1.1.1 2017/02/16 20:06:03 jasper Exp $
  2. From 608763a41a2437a8d3e0e54482d0b5f3d1c1e686 Mon Sep 17 00:00:00 2001
  3. From: Nicolas Viennot <nicolas@viennot.biz>
  4. Date: Tue, 14 Jun 2016 13:46:15 -0400
  5. Subject: [PATCH] Attempt to fix environment related crash
  6. --- cmd-string.c.orig Tue Mar 29 05:30:07 2016
  7. +++ cmd-string.c Wed Feb 8 19:49:43 2017
  8. @@ -307,6 +307,10 @@ cmd_string_variable(const char *s, size_t *p)
  9. free(buf);
  10. if (envent == NULL)
  11. return (xstrdup(""));
  12. +#ifdef TMATE
  13. + if (envent->value == NULL)
  14. + return (xstrdup(""));
  15. +#endif
  16. return (xstrdup(envent->value));
  17. error: