Add error message for ERROR_UNSUPPORTED_FILE_VERSION

parent 99b36152
...@@ -424,7 +424,7 @@ PyObject* convert_object_to_python( ...@@ -424,7 +424,7 @@ PyObject* convert_object_to_python(
case OBJECT_TYPE_STRING: case OBJECT_TYPE_STRING:
if (object->value.ss != NULL) if (object->value.ss != NULL)
result = PyBytes_FromStringAndSize( result = PyBytes_FromStringAndSize(
object->value.ss->c_string, object->value.ss->c_string,
object->value.ss->length); object->value.ss->length);
break; break;
...@@ -903,8 +903,8 @@ PyObject* handle_error( ...@@ -903,8 +903,8 @@ PyObject* handle_error(
{ {
case ERROR_COULD_NOT_ATTACH_TO_PROCESS: case ERROR_COULD_NOT_ATTACH_TO_PROCESS:
return PyErr_Format( return PyErr_Format(
YaraError, YaraError,
"access denied"); "access denied");
case ERROR_INSUFFICIENT_MEMORY: case ERROR_INSUFFICIENT_MEMORY:
return PyErr_NoMemory(); return PyErr_NoMemory();
case ERROR_COULD_NOT_OPEN_FILE: case ERROR_COULD_NOT_OPEN_FILE:
...@@ -936,6 +936,11 @@ PyObject* handle_error( ...@@ -936,6 +936,11 @@ PyObject* handle_error(
YaraError, YaraError,
"external variable \"%s\" was already defined with a different type", "external variable \"%s\" was already defined with a different type",
extra); extra);
case ERROR_UNSUPPORTED_FILE_VERSION:
return PyErr_Format(
YaraError,
"rules file \"%s\" is incompatible with this version of YARA",
extra);
default: default:
return PyErr_Format( return PyErr_Format(
YaraError, YaraError,
......
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