Comment 24 for bug 852760

Revision history for this message
In , Miroslav (miroslav-redhat-bugs) wrote :

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?