diff --git a/lastpass-cli-1.3.1-remove_reallocarray.patch b/lastpass-cli-1.3.1-remove_reallocarray.patch new file mode 100644 index 0000000..bd610f7 --- /dev/null +++ b/lastpass-cli-1.3.1-remove_reallocarray.patch @@ -0,0 +1,34 @@ +diff -up lastpass-cli-1.3.1/util.c.remove_reallocarray lastpass-cli-1.3.1/util.c +--- lastpass-cli-1.3.1/util.c.remove_reallocarray 2018-05-17 11:42:27.000000000 +0200 ++++ lastpass-cli-1.3.1/util.c 2018-07-03 20:14:34.347554160 +0200 +@@ -196,19 +196,6 @@ void *xrealloc(void *ptr, size_t size) + return ret; + die_errno("realloc(%p, %zu)", ptr, size); + } +-void *reallocarray(void *optr, size_t nmemb, size_t size) +-{ +- if (!size || !nmemb) { +- errno = ENOMEM; +- return NULL; +- } +- if ((nmemb >= MUL_NO_OVERFLOW || size >= MUL_NO_OVERFLOW) && +- nmemb > 0 && SIZE_MAX / nmemb < size) { +- errno = ENOMEM; +- return NULL; +- } +- return realloc(optr, size * nmemb); +-} + void *xreallocarray(void *ptr, size_t nmemb, size_t size) + { + void *ret = reallocarray(ptr, nmemb, size); +diff -up lastpass-cli-1.3.1/util.h.remove_reallocarray lastpass-cli-1.3.1/util.h +--- lastpass-cli-1.3.1/util.h.remove_reallocarray 2018-05-17 11:42:27.000000000 +0200 ++++ lastpass-cli-1.3.1/util.h 2018-07-03 20:14:13.644661155 +0200 +@@ -64,7 +64,6 @@ bool ask_yes_no(bool default_yes, const + void *xmalloc(size_t size); + void *xcalloc(size_t nmemb, size_t size); + void *xrealloc(void *ptr, size_t size); +-void *reallocarray(void *ptr, size_t nmemb, size_t size); + void *xreallocarray(void *ptr, size_t nmemb, size_t size); + + void *xstrdup(const char *str);