Initial commit - full huishou project

This commit is contained in:
jiapengyu
2026-07-27 14:07:26 +08:00
commit 60790ad1b3
39127 changed files with 5989265 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
#!/bin/sh
if test $# -eq 0
then
echo "USAGE: $0 <#PR> [<#PR>...]"
exit
fi
commits=
for pr in $*
do
mergecommit=$(git rev-parse ":/Merge pull request #$pr" || exit 1)
mergebase=$(git merge-base "$mergecommit"^1 "$mergecommit"^2 || exit 1)
commits="$commits $(git rev-list --reverse "$mergecommit"^2 ^"$mergebase")"
done
echo "Cherry-picking the following commits:"
git rev-list --no-walk --oneline $commits
echo
git cherry-pick $commits
+6
View File
@@ -0,0 +1,6 @@
#!/bin/sh
export MallocStackLogging=1
export MallocScribble=1
export MallocLogFile=/dev/null
export CLAR_AT_EXIT="leaks -quiet \$PPID"
exec "$@"
+98
View File
@@ -0,0 +1,98 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
void *realloc(void *ptr, size_t size);
void *memmove(void *dest, const void *src, size_t n);
size_t strlen(const char *s);
typedef struct va_list_str *va_list;
typedef struct git_vector {
void **contents;
size_t length;
} git_vector;
typedef struct git_buf {
char *ptr;
size_t asize, size;
} git_buf;
int git_vector_insert(git_vector *v, void *element)
{
if (!v)
__coverity_panic__();
v->contents = realloc(v->contents, ++v->length);
if (!v->contents)
__coverity_panic__();
v->contents[v->length] = element;
return 0;
}
int git_buf_len(const struct git_buf *buf)
{
return strlen(buf->ptr);
}
int git_buf_vprintf(git_buf *buf, const char *format, va_list ap)
{
char ch, *s;
size_t len;
__coverity_string_null_sink__(format);
__coverity_string_size_sink__(format);
ch = *format;
ch = *(char *)ap;
buf->ptr = __coverity_alloc__(len);
__coverity_writeall__(buf->ptr);
buf->size = len;
return 0;
}
int git_buf_put(git_buf *buf, const char *data, size_t len)
{
buf->ptr = __coverity_alloc__(buf->size + len + 1);
memmove(buf->ptr + buf->size, data, len);
buf->size += len;
buf->ptr[buf->size + len] = 0;
return 0;
}
int git_buf_set(git_buf *buf, const void *data, size_t len)
{
buf->ptr = __coverity_alloc__(len + 1);
memmove(buf->ptr, data, len);
buf->size = len + 1;
return 0;
}
void clar__fail(
const char *file,
int line,
const char *error,
const char *description,
int should_abort)
{
if (should_abort)
__coverity_panic__();
}
void clar__assert(
int condition,
const char *file,
int line,
const char *error,
const char *description,
int should_abort)
{
if (!condition && should_abort)
__coverity_panic__();
}
+34
View File
@@ -0,0 +1,34 @@
/*
* Copyright (C) the libgit2 contributors. All rights reserved.
*
* This file is part of libgit2, distributed under the GNU GPL v2 with
* a Linking Exception. For full terms see the included COPYING file.
*/
#nodef GIT_ERROR_CHECK_ALLOC(ptr) if (ptr == NULL) { __coverity_panic__(); }
#nodef GIT_ERROR_CHECK_ALLOC_BUF(buf) if (buf == NULL || git_buf_oom(buf)) { __coverity_panic__(); }
#nodef GITERR_CHECK_ALLOC_ADD(out, one, two) \
if (GIT_ADD_SIZET_OVERFLOW(out, one, two)) { __coverity_panic__(); }
#nodef GITERR_CHECK_ALLOC_ADD3(out, one, two, three) \
if (GIT_ADD_SIZET_OVERFLOW(out, one, two) || \
GIT_ADD_SIZET_OVERFLOW(out, *(out), three)) { __coverity_panic__(); }
#nodef GITERR_CHECK_ALLOC_ADD4(out, one, two, three, four) \
if (GIT_ADD_SIZET_OVERFLOW(out, one, two) || \
GIT_ADD_SIZET_OVERFLOW(out, *(out), three) || \
GIT_ADD_SIZET_OVERFLOW(out, *(out), four)) { __coverity_panic__(); }
#nodef GITERR_CHECK_ALLOC_MULTIPLY(out, nelem, elsize) \
if (GIT_MULTIPLY_SIZET_OVERFLOW(out, nelem, elsize)) { __coverity_panic__(); }
#nodef GIT_ERROR_CHECK_VERSION(S,V,N) if (git_error__check_version(S,V,N) < 0) { __coverity_panic__(); }
#nodef LOOKS_LIKE_DRIVE_PREFIX(S) (strlen(S) >= 2 && git__isalpha((S)[0]) && (S)[1] == ':')
#nodef git_vector_foreach(v, iter, elem) \
for ((iter) = 0; (v)->contents != NULL && (iter) < (v)->length && ((elem) = (v)->contents[(iter)], 1); (iter)++ )
#nodef git_vector_rforeach(v, iter, elem) \
for ((iter) = (v)->length - 1; (v)->contents != NULL && (iter) < SIZE_MAX && ((elem) = (v)->contents[(iter)], 1); (iter)-- )
+2
View File
@@ -0,0 +1,2 @@
#!/bin/bash
exec valgrind --leak-check=full --show-reachable=yes --error-exitcode=125 --num-callers=50 --suppressions="$(dirname "${BASH_SOURCE[0]}")/valgrind.supp" "$@"
+180
View File
@@ -0,0 +1,180 @@
{
ignore-zlib-errors-cond
Memcheck:Cond
obj:*libz.so*
}
{
ignore-giterror-set-leak
Memcheck:Leak
...
fun:giterror_set
}
{
ignore-git-global-state-leak
Memcheck:Leak
...
fun:git__global_state
}
{
ignore-openssl-ssl-leak
Memcheck:Leak
...
obj:*libssl.so*
...
}
{
ignore-openssl-crypto-leak
Memcheck:Leak
...
obj:*libcrypto.so*
...
}
{
ignore-openssl-crypto-cond
Memcheck:Cond
obj:*libcrypto.so*
...
}
{
ignore-glibc-getaddrinfo-cache
Memcheck:Leak
...
fun:__check_pf
}
{
ignore-curl-global-init
Memcheck:Leak
...
fun:curl_global_init
}
{
ignore-libssh2-init
Memcheck:Leak
...
fun:gcry_control
fun:libssh2_init
...
}
{
ignore-libssh2-gcrypt-control-leak
Memcheck:Leak
...
fun:gcry_control
obj:*libssh2.so*
}
{
ignore-libssh2-gcrypt-mpinew-leak
Memcheck:Leak
...
fun:gcry_mpi_new
obj:*libssh2.so*
}
{
ignore-libssh2-gcrypt-mpiscan-leak
Memcheck:Leak
...
fun:gcry_mpi_scan
obj:*libssh2.so*
...
}
{
ignore-libssh2-gcrypt-randomize-leak
Memcheck:Leak
...
fun:gcry_randomize
obj:*libssh2.so*
}
{
ignore-libssh2-gcrypt-sexpfindtoken-leak
Memcheck:Leak
...
fun:gcry_sexp_find_token
obj:*libssh2.so*
}
{
ignore-libssh2-gcrypt-pksign-leak
Memcheck:Leak
...
fun:gcry_pk_sign
obj:*libssh2.so*
}
{
ignore-libssh2-gcrypt-session-handshake
Memcheck:Leak
...
obj:*libssh2.so*
obj:*libssh2.so*
fun:libssh2_session_handshake
...
}
{
ignore-openssl-undefined-in-read
Memcheck:Cond
...
obj:*libssl.so*
...
fun:openssl_read
...
}
{
ignore-openssl-undefined-in-connect
Memcheck:Cond
...
obj:*libssl.so*
...
fun:openssl_connect
...
}
{
ignore-libssh2-rsa-sha1-sign
Memcheck:Leak
...
obj:*libgcrypt.so*
fun:_libssh2_rsa_sha1_sign
...
}
{
ignore-libssh2-kexinit
Memcheck:Leak
...
obj:*libssh2.so*
fun:kexinit
...
}
{
ignore-noai6ai_cached-double-free
Memcheck:Free
fun:free
fun:__libc_freeres
...
fun:exit
...
}
{
ignore-libcrypto-uninitialized-read-for-entropy
Memcheck:Value8
...
obj:*libcrypto.so*
...
}