aboutsummaryrefslogtreecommitdiff
path: root/overflow.c
diff options
context:
space:
mode:
authordruid <druid@devel>2012-01-30 16:44:39 +0100
committerdruid <druid@devel>2012-01-30 16:44:39 +0100
commit984bda19a6a21635d5f7ce2abf97c91cddcd0b12 (patch)
treec8c2da19a65b5898f0321938e5fbd3dc443f7d76 /overflow.c
parent8d64f054048f6402dedbaef11ea5d0f7bd8d530f (diff)
second commit
Diffstat (limited to 'overflow.c')
-rw-r--r--overflow.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/overflow.c b/overflow.c
index de2a1ab..64fc483 100644
--- a/overflow.c
+++ b/overflow.c
@@ -10,25 +10,26 @@
#include <string.h>
#define ENV_VAR "EXPLOIT"
-#define BUFLEN 256
+#define BUFLEN 64
-u_char buf[BUFLEN];
-u_char *env;
+char buf[BUFLEN];
+char *env;
int
main()
{
- if (env = getenv(ENV_VAR))
+ fprintf(stderr, "buflen: %d\nenv_var: %s\n\n", BUFLEN, ENV_VAR);
+ if ( (env = getenv(ENV_VAR)) )
{
- fprintf(stderr, "env: "ENV_VAR" set\n");
+ fprintf(stderr, "env_var: "ENV_VAR"\n");
fprintf(stderr, "env: %s\n", env);
strcpy(buf, env);
}
else
{
- fprintf(stderr, "env: "ENV_VAR" not set, abort!\n");
+ fprintf(stderr, "env_var: "ENV_VAR" not set, abort!\n");
}
- return 0;
+ return(0);
}