Call wtf_init() in fuzzing
This commit is contained in:
@@ -3,6 +3,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <gc.h>
|
#include <gc.h>
|
||||||
#include "wc.h"
|
#include "wc.h"
|
||||||
|
#include "wtf.h"
|
||||||
|
|
||||||
char *get_null_terminated(const uint8_t *data, size_t size) {
|
char *get_null_terminated(const uint8_t *data, size_t size) {
|
||||||
char *new_str = (char *)malloc(size+1);
|
char *new_str = (char *)malloc(size+1);
|
||||||
@@ -28,6 +29,13 @@ int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size){
|
|||||||
GC_set_oom_fn(die_oom);
|
GC_set_oom_fn(die_oom);
|
||||||
#else
|
#else
|
||||||
GC_oom_fn = die_oom;
|
GC_oom_fn = die_oom;
|
||||||
|
#endif
|
||||||
|
#ifdef USE_M17N
|
||||||
|
#ifdef USE_UNICODE
|
||||||
|
wtf_init(WC_CES_UTF_8, WC_CES_UTF_8);
|
||||||
|
#else
|
||||||
|
wtf_init(WC_CES_EUC_JP, WC_CES_EUC_JP);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
init_done = 1;
|
init_done = 1;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user