Valgrind - Invalid read of size 1

I'm getting the next error when running memcheck with valgrind:

Invalid read of size 1

==2511== at 0x4C29852: __GI_strcpy (mc_replace_strmem.c:313)
==2511== by 0x401A76: getstring (reader.c:125)
==2511== by 0x400A0E: main (reader.c:22)
==2511== Address 0x7fefffcfb is just below the stack ptr. To suppress, use: --workaround-gcc296-bugs=yes
1
2
3
4
5
6
7
8

void getstring(void){
char test[1024];
...
string = readstring(pointer);
strcpy(test,string);
...
}


I already searched on stackoverflow, etc. And i guess it has something to do with strcpy(). Help on how to solve this error woud be appreciated.
Last edited on
Topic archived. No new replies allowed.