Commit ed2cc2a8 authored by Sergei Golubchik's avatar Sergei Golubchik

Fix YaSSL on windows

This came with the upgrade from yassl 2.3.0 to 2.3.4 -
ssl tests started to hang on Windows. Comparing and removing changes
I've got to this:

 void input_buffer::set_current(uint i) 
 {
-    if (i)
-        check(i - 1, size_); 
-    current_ = i; 
+    if (error_ == 0 && i && check(i - 1, size_) == 0)
+        current_ = i;
+    else
+        error_ = -1;
 }

in 2.3.0 i==0 was only used to avoid the check, in 2.3.4 it's an error.
but there are places in the code that do set_current(0) and others that
do, like, { before=get_current(); ...; set_current(before); } - and the
initial value of current_ is 0.

So, I suspect that set_current(0) should not be an error, but it should
only skip the check().
parent d851d5e7
......@@ -165,7 +165,7 @@ void input_buffer::set_error()
void input_buffer::set_current(uint i)
{
if (error_ == 0 && i && check(i - 1, size_) == 0)
if (error_ == 0 && (i == 0 || check(i - 1, size_) == 0))
current_ = i;
else
error_ = -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment