Created
April 29, 2018 01:46
-
-
Save adrianparvino/cd418cae5f7a764d5004fb7b1cb31387 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <errno.h> | |
#include <limits.h> | |
#include <stdint.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> | |
int main(void) | |
{ | |
char *a; | |
//a = malloc(SIZE_MAX / 2); | |
errno = 0; | |
a = malloc(SIZE_MAX); | |
a[SIZE_MAX-1] = 'a'; | |
printf("%c\n", *a); | |
//char *b = strerror(errno); | |
//write(2, b, strlen(b)); | |
perror("malloc error\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment