You are not logged in.
Hi ab,
a quick fix is needed in the mormot.core.unicode.FindNameValue, when a different UpperNameSeparator is used other then null, due to how the repeat loop is handled in FindNameValuePointer function, it's entirely possible for length variable to never be initialized and hence picking up whatever garbage is on the stack.
The fix is just really initializing len properly :
function FindNameValue(const NameValuePairs: RawUtf8; UpperName: PAnsiChar;
var Value: RawUtf8; KeepNotFoundValue: boolean; UpperNameSeparator: AnsiChar): boolean;
var
p: PUtf8Char;
len: PtrInt;
begin
len := 0; // < fix
p := FindNameValuePointer(pointer(NameValuePairs), UpperName, len, UpperNameSeparator); Btw, this might be offtopic, have you considered hosting mORMot2 repository on gitlab or somewhere else other then github? I personally avoid anything Microsoft related unless forced by work and I think you used to host a fossil repository if I'm not mistaken so people could contribute.
It's just something to think about, I know freepascal foundation uses gitlab instead so maybe something worth exploring. Hope you have a nice day.
Offline
I guess the fix should rather be in FindNameValuePointer().
Please try
https://github.com/synopse/mORMot2/commit/54c6ce148
Thanks for the feedback!
About GitHub, it has the advantage of giving good visibility to the project.
I don't see any real problem about it yet. I did prefer fossil for sure, but dual repositories was not worth it.
Offline