fix OBOB, increase length since this may be what slowed manticore down

This commit is contained in:
Alex Groce 2019-01-01 01:20:09 -07:00
parent 00b77202e3
commit 7431a9bd1b
2 changed files with 4 additions and 4 deletions

View File

@ -37,7 +37,7 @@ char* decode(const char* output) {
}
// Can be (much) higher (e.g., > 1024) if we're using fuzzing, not symbolic execution
#define MAX_STR_LEN 2
#define MAX_STR_LEN 3
TEST(Runlength, EncodeDecode) {
char* original = DeepState_CStrUpToLen(MAX_STR_LEN, "ab");

View File

@ -189,7 +189,7 @@ void DeepState_AssignCStr_C(char* str, size_t len, const char* allowed) {
} else {
uint32_t allowed_size = strlen(allowed);
for (int i = 0; i < len; i++) {
str[i] = allowed[DeepState_UIntInRange(0, allowed_size)];
str[i] = allowed[DeepState_UIntInRange(0, allowed_size-1)];
}
}
}
@ -212,7 +212,7 @@ char *DeepState_CStr_C(size_t len, const char* allowed) {
} else {
uint32_t allowed_size = strlen(allowed);
for (int i = 0; i < len; i++) {
str[i] = allowed[DeepState_UIntInRange(0, allowed_size)];
str[i] = allowed[DeepState_UIntInRange(0, allowed_size-1)];
}
}
}
@ -231,7 +231,7 @@ void DeepState_SymbolizeCStr_C(char *begin, const char* allowed) {
uintptr_t begin_addr = (uintptr_t) begin;
uintptr_t end_addr = (uintptr_t) (begin + strlen(begin));
for (uintptr_t i = 0, max_i = (end_addr - begin_addr); i < max_i; ++i) {
bytes[i] = allowed[DeepState_UIntInRange(0, allowed_size)];
bytes[i] = allowed[DeepState_UIntInRange(0, allowed_size-1)];
}
}
}