В выводе valgrind ниже, может ли кто-нибудь объяснить значение верхней строки, которая refrences strlen в библиотеке valgrind. Означает ли это, что у valgrind itslef есть ошибка?valgrind недействительный размер чтения
==26147== Invalid read of size 1
==26147== at 0x4C2E0E2: strlen (in/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==26147== by 0x40263A: urldecode (server.c:1131)
==26147== by 0x401853: main (server.c:199)
==26147== Address 0xffefffaa0 is on thread 1's stack
==26147== 136 bytes below stack pointer
char* urldecode(const char* s)
{
// check whether s is NULL
if (s == NULL)
{
return NULL;
}
// allocate enough (zeroed) memory for an undecoded copy of s
char* t = calloc(strlen(s) + 1, 1); <--- line 1131
Лучше смотришь на 'server.c: 1131' –
Будьте осторожны с обвинениями в ваших ошибках. Обычно (но не всегда) свой собственный код. –
Почтовый код, который воспроизводит проблему. –