char * NameDecoded = (char *) malloc(strlen(Name) + 12);
char * ValueDecoded = (char *) malloc(strlen(Value) + 12);
if(!URLDecode(Name, NameDecoded, strlen(Name) + 8) ||
!URLDecode(Value, ValueDecoded, strlen(Value) + 8))
I'm pretty sure you also don't want to accept and honor any arbitrary 64 bit value for Content-length.And I'm also pretty sure Content-length can't be negative and doesn't belong in a signed integer.