pacemaker
3.0.1-16e74fc4da
Scalable High-Availability cluster resource manager
Loading...
Searching...
No Matches
lib
common
fuzzers
scores_fuzzer.c
Go to the documentation of this file.
1
/*
2
* Copyright 2024 the Pacemaker project contributors
3
*
4
* The version control history for this file may have further details.
5
*
6
* This source code is licensed under the GNU Lesser General Public License
7
* version 2.1 or later (LGPLv2.1+) WITHOUT ANY WARRANTY.
8
*/
9
10
#include <stdint.h>
11
#include <stdlib.h>
12
#include <stdio.h>
13
14
#include <
crm/common/util.h
>
15
#include <
crm/common/internal.h
>
16
17
int
18
LLVMFuzzerTestOneInput
(
const
uint8_t *
data
,
size_t
size
)
19
{
20
char
*ns = NULL;
21
guint
result
= 0U;
22
23
if
(
size
> 0) {
24
ns =
pcmk__assert_alloc
(1,
size
+ 1);
25
memcpy(ns,
data
,
size
);
26
ns[
size
] =
'\0'
;
27
}
28
29
pcmk_str_is_infinity
(ns);
30
pcmk_str_is_minus_infinity
(ns);
31
32
free(ns);
33
return
0;
34
}
internal.h
pcmk__assert_alloc
#define pcmk__assert_alloc(nmemb, size)
Definition
internal.h:246
util.h
Utility functions.
data
char data[0]
Definition
cpg.c:10
size
uint32_t size
Definition
cpg.c:4
result
pcmk__action_result_t result
Definition
pcmk_fence.c:37
pcmk_str_is_infinity
bool pcmk_str_is_infinity(const char *s)
Definition
scores.c:130
pcmk_str_is_minus_infinity
bool pcmk_str_is_minus_infinity(const char *s)
Definition
scores.c:144
LLVMFuzzerTestOneInput
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
Definition
scores_fuzzer.c:18
Generated on Thu Aug 7 2025 12:04:47 for pacemaker by
1.12.0