[Forensics-changes] [yara] 307/407: Remove IS_UNDEFINED checks after e275dcb6.
Hilko Bengen
bengen at moszumanska.debian.org
Sat Jul 1 10:28:39 UTC 2017
This is an automated email from the git hooks/post-receive script.
bengen pushed a commit to annotated tag v3.3.0
in repository yara.
commit 4062f05db0fd1d245c6a79cdd967773419013d98
Author: Wesley Shields <wxs at atarininja.org>
Date: Sat Jan 3 21:02:51 2015 -0500
Remove IS_UNDEFINED checks after e275dcb6.
---
libyara/modules/math.c | 33 ---------------------------------
1 file changed, 33 deletions(-)
diff --git a/libyara/modules/math.c b/libyara/modules/math.c
index 5f158b5..06d321c 100644
--- a/libyara/modules/math.c
+++ b/libyara/modules/math.c
@@ -33,9 +33,6 @@ define_function(string_entropy)
double entropy = 0.0;
SIZED_STRING* s = sized_string_argument(1);
- if (IS_UNDEFINED(s))
- return_double(UNDEFINED);
-
data = (uint32_t*) yr_calloc(256, sizeof(uint32_t));
if (data == NULL)
return_double(UNDEFINED);
@@ -72,9 +69,6 @@ define_function(data_entropy)
int64_t offset = integer_argument(1); // offset where to start
int64_t length = integer_argument(2); // length of bytes we want entropy on
- if (IS_UNDEFINED(offset) || IS_UNDEFINED(length))
- return_double(UNDEFINED);
-
YR_SCAN_CONTEXT* context = scan_context();
YR_MEMORY_BLOCK* block = NULL;
@@ -150,9 +144,6 @@ define_function(string_deviation)
SIZED_STRING* s = sized_string_argument(1);
double mean = double_argument(2);
- if (IS_UNDEFINED(s) || IS_UNDEFINED(mean))
- return_double(UNDEFINED);
-
for (i = 0; i < s->length; i++)
sum += fabs(((double) s->c_string[i]) - mean);
@@ -171,9 +162,6 @@ define_function(data_deviation)
int64_t length = integer_argument(2);
double mean = double_argument(3);
- if (IS_UNDEFINED(offset) || IS_UNDEFINED(length) || IS_UNDEFINED(mean))
- return_double(UNDEFINED);
-
YR_SCAN_CONTEXT* context = scan_context();
YR_MEMORY_BLOCK* block = NULL;
@@ -228,9 +216,6 @@ define_function(string_mean)
SIZED_STRING* s = sized_string_argument(1);
double mean = double_argument(2);
- if (IS_UNDEFINED(s) || IS_UNDEFINED(mean))
- return_double(UNDEFINED);
-
for (i = 0; i < s->length; i++)
sum += (double) s->c_string[i];
@@ -250,9 +235,6 @@ define_function(data_mean)
int64_t length = integer_argument(2);
double mean = double_argument(3);
- if (IS_UNDEFINED(offset) || IS_UNDEFINED(length) || IS_UNDEFINED(mean))
- return_double(UNDEFINED);
-
YR_SCAN_CONTEXT* context = scan_context();
YR_MEMORY_BLOCK* block = NULL;
@@ -310,9 +292,6 @@ define_function(data_serial_correlation)
int64_t offset = integer_argument(1);
int64_t length = integer_argument(2);
- if (IS_UNDEFINED(offset) || IS_UNDEFINED(length))
- return_double(UNDEFINED);
-
YR_SCAN_CONTEXT* context = scan_context();
YR_MEMORY_BLOCK* block = NULL;
@@ -385,9 +364,6 @@ define_function(string_serial_correlation)
double scc, sccun, scclast, scct1, scct2, scct3;
SIZED_STRING* s = sized_string_argument(1);
- if (IS_UNDEFINED(s))
- return_double(UNDEFINED);
-
scct1 = scct2 = scct3 = 0.0;
for (i = 0; i < s->length; i++)
{
@@ -428,9 +404,6 @@ define_function(data_monte_carlo_pi)
int64_t offset = integer_argument(1);
int64_t length = integer_argument(2);
- if (IS_UNDEFINED(offset) || IS_UNDEFINED(length))
- return_double(UNDEFINED);
-
YR_SCAN_CONTEXT* context = scan_context();
YR_MEMORY_BLOCK* block = NULL;
@@ -503,9 +476,6 @@ define_function(string_monte_carlo_pi)
SIZED_STRING* s = sized_string_argument(1);
- if (IS_UNDEFINED(s))
- return_double(UNDEFINED);
-
for (i = 0; i < s->length; i++)
{
monte[idx++] = (unsigned int) s->c_string[i];
@@ -535,9 +505,6 @@ define_function(in_range)
double lower = double_argument(2);
double upper = double_argument(3);
- if (IS_UNDEFINED(test) || IS_UNDEFINED(lower) || IS_UNDEFINED(upper))
- return_double(UNDEFINED);
-
return_integer((lower <= test && test <= upper) ? 1 : 0);
}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git
More information about the forensics-changes
mailing list