VirtualBox

source: vbox/trunk/src/libs/openssl-3.1.5/fuzz/punycode.c@ 105132

最後變更 在這個檔案從105132是 104204,由 vboxsync 提交於 12 月 前

fixing export flags in libs

檔案大小: 982 位元組
 
1/*
2 * Copyright 2022 The OpenSSL Project Authors. All Rights Reserved.
3 *
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
8 */
9
10#include "crypto/punycode.h"
11#include "internal/nelem.h"
12#include <openssl/crypto.h>
13#include "fuzzer.h"
14
15#include <stdio.h>
16#include <string.h>
17
18int FuzzerInitialize(int *argc, char ***argv)
19{
20 return 1;
21}
22
23int FuzzerTestOneInput(const uint8_t *buf, size_t len)
24{
25 char *b;
26 unsigned int out[16], outlen = OSSL_NELEM(out);
27 char outc[16];
28
29 b = OPENSSL_malloc(len + 1);
30 if (b != NULL) {
31 ossl_punycode_decode((const char *)buf, len, out, &outlen);
32 memcpy(b, buf, len);
33 b[len] = '\0';
34 ossl_a2ulabel(b, outc, sizeof(outc));
35 OPENSSL_free(b);
36 }
37 return 0;
38}
39
40void FuzzerCleanup(void)
41{
42}
注意: 瀏覽 TracBrowser 來幫助您使用儲存庫瀏覽器

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette