diff --git a/src/regression/execle-env.c b/src/regression/execle-env.c index d3a8b4e..21f296c 100644 --- a/src/regression/execle-env.c +++ b/src/regression/execle-env.c @@ -1,3 +1,4 @@ +// commit 2b2aff37aced66e4a50a38a14607a9b1dc0ee001 2013-10-03 // execle should pass env properly #include #include diff --git a/src/regression/setenv-oom.c b/src/regression/setenv-oom.c new file mode 100644 index 0000000..d7e6162 --- /dev/null +++ b/src/regression/setenv-oom.c @@ -0,0 +1,25 @@ +// commit 543787039098c121917cb5f3e129d84b61afa61b 2013-10-04 +// setenv should not crash on oom +#include +#include +#include +#include "test.h" + +int main(void) +{ + char buf[10000]; + + if (t_vmfill(0,0,0) < 0) + t_error("vmfill failed: %s\n", strerror(errno)); + + memset(buf, 'x', sizeof buf); + buf[sizeof buf - 1] = 0; + + errno = 0; + if (setenv("TESTVAR", buf, 1) != -1) + t_error("setenv was successful\n"); + if (errno != ENOMEM) + t_error("expected ENOMEM, got %s\n", strerror(errno)); + + return t_status; +}