do size check on user password input

This commit is contained in:
toddouska 2013-12-23 12:24:03 -08:00
parent 3c706b4645
commit 29c41da818

View File

@ -1063,7 +1063,7 @@ static INLINE int OurPasswordCb(char* passwd, int sz, int rw, void* userdata)
return 0;
XSTRNCPY(passwd, (char*)userdata, sz);
return (int)XSTRLEN((char*)userdata);
return min((word32)sz, (word32)XSTRLEN((char*)userdata));
}