Looks like a gcc bug, perhaps a wrong assumption about alignment of the buffer returned by realloc?
Reproducer:
#include <stdio.h> #include <string.h> #include <stdlib.h>
int main() { char *x;
x = malloc(4); x = realloc(x, 15); sprintf(x, "www.xn--4cab6c"); return strlen(x); }
Can this cause problems outside valgrind?
Looks like a gcc bug, perhaps a wrong assumption about alignment of the buffer returned by realloc?
Reproducer:
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int main() {
char *x;
x = malloc(4);
x = realloc(x, 15);
sprintf(x, "www.xn--4cab6c");
return strlen(x);
}
Can this cause problems outside valgrind?