rugged 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/ext/rugged/rugged_commit.c +1 -1
- data/lib/rugged/commit.rb +16 -2
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/CMakeLists.txt +31 -69
- data/vendor/libgit2/cmake/{Modules/AddCFlagIfSupported.cmake → AddCFlagIfSupported.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/EnableWarnings.cmake → EnableWarnings.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindCoreFoundation.cmake → FindCoreFoundation.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSAPI.cmake → FindGSSAPI.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindGSSFramework.cmake → FindGSSFramework.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindHTTP_Parser.cmake → FindHTTP_Parser.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindIconv.cmake → FindIconv.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE.cmake → FindPCRE.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPCRE2.cmake → FindPCRE2.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindPkgLibraries.cmake → FindPkgLibraries.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindSecurity.cmake → FindSecurity.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindStatNsec.cmake → FindStatNsec.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/FindmbedTLS.cmake → FindmbedTLS.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/IdeSplitSources.cmake → IdeSplitSources.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/PkgBuildConfig.cmake → PkgBuildConfig.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SanitizeBool.cmake → SanitizeBool.cmake} +0 -0
- data/vendor/libgit2/cmake/{Modules/SelectGSSAPI.cmake → SelectGSSAPI.cmake} +18 -26
- data/vendor/libgit2/cmake/{Modules/SelectHTTPSBackend.cmake → SelectHTTPSBackend.cmake} +25 -32
- data/vendor/libgit2/cmake/{Modules/SelectHashes.cmake → SelectHashes.cmake} +20 -28
- data/vendor/libgit2/deps/http-parser/CMakeLists.txt +4 -3
- data/vendor/libgit2/deps/ntlmclient/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/ntlmclient/compat.h +8 -1
- data/vendor/libgit2/deps/ntlmclient/ntlm.c +8 -11
- data/vendor/libgit2/deps/pcre/LICENCE +93 -0
- data/vendor/libgit2/deps/pcre/pcre.h +2 -2
- data/vendor/libgit2/deps/pcre/pcre_compile.c +29 -17
- data/vendor/libgit2/deps/pcre/pcre_jit_compile.c +4 -4
- data/vendor/libgit2/deps/pcre/pcreposix.c +2 -3
- data/vendor/libgit2/deps/zlib/CMakeLists.txt +6 -5
- data/vendor/libgit2/deps/zlib/deflate.c +1 -0
- data/vendor/libgit2/include/git2/annotated_commit.h +1 -1
- data/vendor/libgit2/include/git2/blame.h +2 -0
- data/vendor/libgit2/include/git2/common.h +15 -3
- data/vendor/libgit2/include/git2/deprecated.h +42 -2
- data/vendor/libgit2/include/git2/errors.h +2 -1
- data/vendor/libgit2/include/git2/index.h +1 -2
- data/vendor/libgit2/include/git2/pack.h +1 -1
- data/vendor/libgit2/include/git2/strarray.h +6 -10
- data/vendor/libgit2/include/git2/version.h +4 -4
- data/vendor/libgit2/src/CMakeLists.txt +53 -41
- data/vendor/libgit2/src/apply.c +5 -1
- data/vendor/libgit2/src/assert_safe.h +58 -0
- data/vendor/libgit2/src/attr_file.c +8 -3
- data/vendor/libgit2/src/attrcache.c +2 -3
- data/vendor/libgit2/src/blame.c +2 -0
- data/vendor/libgit2/src/blame_git.c +6 -3
- data/vendor/libgit2/src/blob.c +2 -0
- data/vendor/libgit2/src/branch.c +19 -21
- data/vendor/libgit2/src/buffer.c +6 -3
- data/vendor/libgit2/src/cache.c +1 -22
- data/vendor/libgit2/src/checkout.c +49 -72
- data/vendor/libgit2/src/cherrypick.c +2 -0
- data/vendor/libgit2/src/clone.c +78 -18
- data/vendor/libgit2/src/common.h +1 -0
- data/vendor/libgit2/src/config.c +3 -7
- data/vendor/libgit2/src/config_entries.c +35 -27
- data/vendor/libgit2/src/config_parse.c +1 -1
- data/vendor/libgit2/src/config_snapshot.c +2 -1
- data/vendor/libgit2/src/describe.c +5 -1
- data/vendor/libgit2/src/diff.c +12 -11
- data/vendor/libgit2/src/diff_file.c +3 -1
- data/vendor/libgit2/src/diff_generate.c +10 -11
- data/vendor/libgit2/src/diff_parse.c +2 -3
- data/vendor/libgit2/src/diff_print.c +63 -60
- data/vendor/libgit2/src/diff_stats.c +12 -11
- data/vendor/libgit2/src/diff_tform.c +2 -3
- data/vendor/libgit2/src/errors.c +2 -0
- data/vendor/libgit2/src/fetch.c +2 -0
- data/vendor/libgit2/src/filter.c +3 -3
- data/vendor/libgit2/src/futils.c +3 -3
- data/vendor/libgit2/src/futils.h +3 -3
- data/vendor/libgit2/src/global.c +3 -1
- data/vendor/libgit2/src/idxmap.c +0 -22
- data/vendor/libgit2/src/index.c +12 -7
- data/vendor/libgit2/src/indexer.c +10 -4
- data/vendor/libgit2/src/iterator.c +4 -4
- data/vendor/libgit2/src/merge.c +13 -7
- data/vendor/libgit2/src/merge_file.c +4 -6
- data/vendor/libgit2/src/midx.c +418 -0
- data/vendor/libgit2/src/midx.h +83 -0
- data/vendor/libgit2/src/mwindow.c +124 -51
- data/vendor/libgit2/src/net.c +6 -1
- data/vendor/libgit2/src/object.c +2 -1
- data/vendor/libgit2/src/odb.c +9 -6
- data/vendor/libgit2/src/odb_loose.c +3 -3
- data/vendor/libgit2/src/odb_mempack.c +2 -0
- data/vendor/libgit2/src/oid.c +2 -0
- data/vendor/libgit2/src/pack-objects.c +29 -21
- data/vendor/libgit2/src/pack.c +47 -28
- data/vendor/libgit2/src/pack.h +19 -2
- data/vendor/libgit2/src/patch_generate.c +1 -3
- data/vendor/libgit2/src/patch_parse.c +4 -2
- data/vendor/libgit2/src/path.c +4 -4
- data/vendor/libgit2/src/pathspec.c +4 -3
- data/vendor/libgit2/src/pool.c +21 -15
- data/vendor/libgit2/src/pool.h +9 -1
- data/vendor/libgit2/src/proxy.c +2 -0
- data/vendor/libgit2/src/push.c +2 -0
- data/vendor/libgit2/src/rebase.c +2 -0
- data/vendor/libgit2/src/refdb.c +135 -0
- data/vendor/libgit2/src/refdb.h +69 -0
- data/vendor/libgit2/src/refdb_fs.c +19 -81
- data/vendor/libgit2/src/reflog.c +2 -6
- data/vendor/libgit2/src/refs.c +60 -188
- data/vendor/libgit2/src/refs.h +1 -19
- data/vendor/libgit2/src/regexp.c +2 -2
- data/vendor/libgit2/src/remote.c +32 -17
- data/vendor/libgit2/src/repository.c +168 -79
- data/vendor/libgit2/src/repository.h +10 -27
- data/vendor/libgit2/src/revert.c +2 -0
- data/vendor/libgit2/src/revparse.c +5 -4
- data/vendor/libgit2/src/revwalk.c +3 -5
- data/vendor/libgit2/src/settings.c +9 -0
- data/vendor/libgit2/src/sortedcache.c +2 -3
- data/vendor/libgit2/src/stash.c +2 -0
- data/vendor/libgit2/src/status.c +2 -0
- data/vendor/libgit2/src/strarray.c +63 -0
- data/vendor/libgit2/src/streams/openssl.c +12 -6
- data/vendor/libgit2/src/streams/registry.c +5 -3
- data/vendor/libgit2/src/submodule.c +6 -4
- data/vendor/libgit2/src/sysdir.c +4 -20
- data/vendor/libgit2/src/sysdir.h +0 -11
- data/vendor/libgit2/src/tag.c +2 -0
- data/vendor/libgit2/src/thread-utils.h +139 -21
- data/vendor/libgit2/src/transaction.c +2 -1
- data/vendor/libgit2/src/transports/credential.c +2 -0
- data/vendor/libgit2/src/transports/credential_helpers.c +2 -0
- data/vendor/libgit2/src/transports/httpclient.c +6 -8
- data/vendor/libgit2/src/transports/local.c +2 -2
- data/vendor/libgit2/src/transports/smart.c +2 -2
- data/vendor/libgit2/src/transports/winhttp.c +18 -7
- data/vendor/libgit2/src/unix/posix.h +13 -1
- data/vendor/libgit2/src/util.c +25 -58
- data/vendor/libgit2/src/util.h +2 -2
- data/vendor/libgit2/src/win32/git2.rc +18 -3
- data/vendor/libgit2/src/win32/path_w32.c +2 -2
- data/vendor/libgit2/src/worktree.c +4 -0
- metadata +27 -25
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.c.in +0 -29
- data/vendor/libgit2/cmake/Modules/CheckPrototypeDefinition.cmake +0 -96
- data/vendor/libgit2/src/refdb_fs.h +0 -19
@@ -1,5 +1,6 @@
|
|
1
|
-
|
1
|
+
file(GLOB SRC_HTTP "*.c" "*.h")
|
2
|
+
list(SORT SRC_HTTP)
|
2
3
|
|
3
|
-
|
4
|
+
add_library(http-parser OBJECT ${SRC_HTTP})
|
4
5
|
|
5
|
-
|
6
|
+
enable_warnings(implicit-fallthrough=1)
|
@@ -1,23 +1,24 @@
|
|
1
1
|
FILE(GLOB SRC_NTLMCLIENT "ntlm.c" "unicode_builtin.c" "util.c")
|
2
|
+
LIST(SORT SRC_NTLMCLIENT)
|
2
3
|
|
3
4
|
ADD_DEFINITIONS(-DNTLM_STATIC=1)
|
4
5
|
|
5
6
|
DISABLE_WARNINGS(implicit-fallthrough)
|
6
7
|
|
7
|
-
IF
|
8
|
+
IF(USE_HTTPS STREQUAL "SecureTransport")
|
8
9
|
ADD_DEFINITIONS(-DCRYPT_COMMONCRYPTO)
|
9
10
|
SET(SRC_NTLMCLIENT_CRYPTO "crypt_commoncrypto.c")
|
10
11
|
# CC_MD4 has been deprecated in macOS 10.15.
|
11
12
|
SET_SOURCE_FILES_PROPERTIES("crypt_commoncrypto.c" COMPILE_FLAGS "-Wno-deprecated")
|
12
|
-
ELSEIF
|
13
|
+
ELSEIF(USE_HTTPS STREQUAL "OpenSSL")
|
13
14
|
ADD_DEFINITIONS(-DCRYPT_OPENSSL)
|
14
15
|
INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR})
|
15
16
|
SET(SRC_NTLMCLIENT_CRYPTO "crypt_openssl.c")
|
16
|
-
ELSEIF
|
17
|
+
ELSEIF(USE_HTTPS STREQUAL "mbedTLS")
|
17
18
|
ADD_DEFINITIONS(-DCRYPT_MBEDTLS)
|
18
19
|
SET(SRC_NTLMCLIENT_CRYPTO "crypt_mbedtls.c")
|
19
|
-
ELSE
|
20
|
-
MESSAGE(FATAL_ERROR "Unable to use libgit2's HTTPS backend (${
|
20
|
+
ELSE()
|
21
|
+
MESSAGE(FATAL_ERROR "Unable to use libgit2's HTTPS backend (${USE_HTTPS}) for NTLM crypto")
|
21
22
|
ENDIF()
|
22
23
|
|
23
24
|
ADD_LIBRARY(ntlmclient OBJECT ${SRC_NTLMCLIENT} ${SRC_NTLMCLIENT_CRYPTO})
|
@@ -21,7 +21,9 @@
|
|
21
21
|
# include <stdbool.h>
|
22
22
|
#endif
|
23
23
|
|
24
|
-
#
|
24
|
+
#if defined(_WIN32) || defined(__APPLE__)
|
25
|
+
/* winsock and macOS > 10.9 have htonll already */
|
26
|
+
#elif defined(__linux__)
|
25
27
|
/* See man page endian(3) */
|
26
28
|
# include <endian.h>
|
27
29
|
# define htonll htobe64
|
@@ -46,6 +48,11 @@
|
|
46
48
|
# define htonll(x) ((((uint64_t)htonl(x)) << 32) + htonl((uint64_t)(x) >> 32))
|
47
49
|
# endif
|
48
50
|
# endif
|
51
|
+
#elif defined(__HAIKU__)
|
52
|
+
# include <ByteOrder.h>
|
53
|
+
# define htonll B_HOST_TO_BENDIAN_INT64
|
54
|
+
#else
|
55
|
+
# error "Please implement htonll for your platform"
|
49
56
|
#endif
|
50
57
|
|
51
58
|
#ifndef MIN
|
@@ -47,11 +47,9 @@ ntlm_client *ntlm_client_init(ntlm_client_flags flags)
|
|
47
47
|
{
|
48
48
|
ntlm_client *ntlm = NULL;
|
49
49
|
|
50
|
-
if ((ntlm =
|
50
|
+
if ((ntlm = calloc(1, sizeof(ntlm_client))) == NULL)
|
51
51
|
return NULL;
|
52
52
|
|
53
|
-
memset(ntlm, 0, sizeof(ntlm_client));
|
54
|
-
|
55
53
|
ntlm->flags = flags;
|
56
54
|
|
57
55
|
if ((ntlm->hmac_ctx = ntlm_hmac_ctx_init()) == NULL ||
|
@@ -260,6 +258,9 @@ static inline bool write_buf(
|
|
260
258
|
const unsigned char *buf,
|
261
259
|
size_t len)
|
262
260
|
{
|
261
|
+
if (!len)
|
262
|
+
return true;
|
263
|
+
|
263
264
|
if (out->len - out->pos < len) {
|
264
265
|
ntlm_client_set_errmsg(ntlm, "out of buffer space");
|
265
266
|
return false;
|
@@ -648,13 +649,11 @@ int ntlm_client_negotiate(
|
|
648
649
|
return -1;
|
649
650
|
}
|
650
651
|
|
651
|
-
if ((ntlm->negotiate.buf =
|
652
|
+
if ((ntlm->negotiate.buf = calloc(1, ntlm->negotiate.len)) == NULL) {
|
652
653
|
ntlm_client_set_errmsg(ntlm, "out of memory");
|
653
654
|
return -1;
|
654
655
|
}
|
655
656
|
|
656
|
-
memset(ntlm->negotiate.buf, 0, ntlm->negotiate.len);
|
657
|
-
|
658
657
|
if (!write_buf(ntlm, &ntlm->negotiate,
|
659
658
|
ntlm_client_signature, sizeof(ntlm_client_signature)) ||
|
660
659
|
!write_int32(ntlm, &ntlm->negotiate, 1) ||
|
@@ -1122,7 +1121,7 @@ static bool generate_ntlm2_challengehash(
|
|
1122
1121
|
static bool generate_lm2_response(ntlm_client *ntlm,
|
1123
1122
|
unsigned char ntlm2_hash[NTLM_NTLM2_HASH_LEN])
|
1124
1123
|
{
|
1125
|
-
unsigned char lm2_challengehash[16];
|
1124
|
+
unsigned char lm2_challengehash[16] = {0};
|
1126
1125
|
size_t lm2_len = 16;
|
1127
1126
|
uint64_t local_nonce;
|
1128
1127
|
|
@@ -1177,7 +1176,7 @@ static bool generate_ntlm2_response(ntlm_client *ntlm)
|
|
1177
1176
|
uint32_t signature;
|
1178
1177
|
uint64_t timestamp, nonce;
|
1179
1178
|
unsigned char ntlm2_hash[NTLM_NTLM2_HASH_LEN];
|
1180
|
-
unsigned char challengehash[16];
|
1179
|
+
unsigned char challengehash[16] = {0};
|
1181
1180
|
unsigned char *blob;
|
1182
1181
|
|
1183
1182
|
if (!generate_timestamp(ntlm) ||
|
@@ -1334,13 +1333,11 @@ int ntlm_client_response(
|
|
1334
1333
|
return -1;
|
1335
1334
|
}
|
1336
1335
|
|
1337
|
-
if ((ntlm->response.buf =
|
1336
|
+
if ((ntlm->response.buf = calloc(1, ntlm->response.len)) == NULL) {
|
1338
1337
|
ntlm_client_set_errmsg(ntlm, "out of memory");
|
1339
1338
|
return -1;
|
1340
1339
|
}
|
1341
1340
|
|
1342
|
-
memset(ntlm->response.buf, 0, ntlm->response.len);
|
1343
|
-
|
1344
1341
|
if (!write_buf(ntlm, &ntlm->response,
|
1345
1342
|
ntlm_client_signature, sizeof(ntlm_client_signature)) ||
|
1346
1343
|
!write_int32(ntlm, &ntlm->response, 3) ||
|
@@ -0,0 +1,93 @@
|
|
1
|
+
PCRE LICENCE
|
2
|
+
------------
|
3
|
+
|
4
|
+
PCRE is a library of functions to support regular expressions whose syntax
|
5
|
+
and semantics are as close as possible to those of the Perl 5 language.
|
6
|
+
|
7
|
+
Release 8 of PCRE is distributed under the terms of the "BSD" licence, as
|
8
|
+
specified below. The documentation for PCRE, supplied in the "doc"
|
9
|
+
directory, is distributed under the same terms as the software itself. The data
|
10
|
+
in the testdata directory is not copyrighted and is in the public domain.
|
11
|
+
|
12
|
+
The basic library functions are written in C and are freestanding. Also
|
13
|
+
included in the distribution is a set of C++ wrapper functions, and a
|
14
|
+
just-in-time compiler that can be used to optimize pattern matching. These
|
15
|
+
are both optional features that can be omitted when the library is built.
|
16
|
+
|
17
|
+
|
18
|
+
THE BASIC LIBRARY FUNCTIONS
|
19
|
+
---------------------------
|
20
|
+
|
21
|
+
Written by: Philip Hazel
|
22
|
+
Email local part: ph10
|
23
|
+
Email domain: cam.ac.uk
|
24
|
+
|
25
|
+
University of Cambridge Computing Service,
|
26
|
+
Cambridge, England.
|
27
|
+
|
28
|
+
Copyright (c) 1997-2020 University of Cambridge
|
29
|
+
All rights reserved.
|
30
|
+
|
31
|
+
|
32
|
+
PCRE JUST-IN-TIME COMPILATION SUPPORT
|
33
|
+
-------------------------------------
|
34
|
+
|
35
|
+
Written by: Zoltan Herczeg
|
36
|
+
Email local part: hzmester
|
37
|
+
Email domain: freemail.hu
|
38
|
+
|
39
|
+
Copyright(c) 2010-2020 Zoltan Herczeg
|
40
|
+
All rights reserved.
|
41
|
+
|
42
|
+
|
43
|
+
STACK-LESS JUST-IN-TIME COMPILER
|
44
|
+
--------------------------------
|
45
|
+
|
46
|
+
Written by: Zoltan Herczeg
|
47
|
+
Email local part: hzmester
|
48
|
+
Email domain: freemail.hu
|
49
|
+
|
50
|
+
Copyright(c) 2009-2020 Zoltan Herczeg
|
51
|
+
All rights reserved.
|
52
|
+
|
53
|
+
|
54
|
+
THE C++ WRAPPER FUNCTIONS
|
55
|
+
-------------------------
|
56
|
+
|
57
|
+
Contributed by: Google Inc.
|
58
|
+
|
59
|
+
Copyright (c) 2007-2012, Google Inc.
|
60
|
+
All rights reserved.
|
61
|
+
|
62
|
+
|
63
|
+
THE "BSD" LICENCE
|
64
|
+
-----------------
|
65
|
+
|
66
|
+
Redistribution and use in source and binary forms, with or without
|
67
|
+
modification, are permitted provided that the following conditions are met:
|
68
|
+
|
69
|
+
* Redistributions of source code must retain the above copyright notice,
|
70
|
+
this list of conditions and the following disclaimer.
|
71
|
+
|
72
|
+
* Redistributions in binary form must reproduce the above copyright
|
73
|
+
notice, this list of conditions and the following disclaimer in the
|
74
|
+
documentation and/or other materials provided with the distribution.
|
75
|
+
|
76
|
+
* Neither the name of the University of Cambridge nor the name of Google
|
77
|
+
Inc. nor the names of their contributors may be used to endorse or
|
78
|
+
promote products derived from this software without specific prior
|
79
|
+
written permission.
|
80
|
+
|
81
|
+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
|
82
|
+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
|
83
|
+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
84
|
+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
|
85
|
+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
86
|
+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
|
87
|
+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
|
88
|
+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
|
89
|
+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
|
90
|
+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
91
|
+
POSSIBILITY OF SUCH DAMAGE.
|
92
|
+
|
93
|
+
End
|
@@ -42,9 +42,9 @@ POSSIBILITY OF SUCH DAMAGE.
|
|
42
42
|
/* The current PCRE version information. */
|
43
43
|
|
44
44
|
#define PCRE_MAJOR 8
|
45
|
-
#define PCRE_MINOR
|
45
|
+
#define PCRE_MINOR 44
|
46
46
|
#define PCRE_PRERELEASE
|
47
|
-
#define PCRE_DATE
|
47
|
+
#define PCRE_DATE 2020-02-12
|
48
48
|
|
49
49
|
#define PCRE_EXP_DECL extern
|
50
50
|
|
@@ -6,7 +6,7 @@
|
|
6
6
|
and semantics are as close as possible to those of the Perl 5 language.
|
7
7
|
|
8
8
|
Written by Philip Hazel
|
9
|
-
Copyright (c) 1997-
|
9
|
+
Copyright (c) 1997-2020 University of Cambridge
|
10
10
|
|
11
11
|
-----------------------------------------------------------------------------
|
12
12
|
Redistribution and use in source and binary forms, with or without
|
@@ -68,7 +68,7 @@ COMPILE_PCREx macro will already be appropriately set. */
|
|
68
68
|
|
69
69
|
/* Macro for setting individual bits in class bitmaps. */
|
70
70
|
|
71
|
-
#define SETBIT(a,b) a[(b)/8] |= (
|
71
|
+
#define SETBIT(a,b) a[(b)/8] |= (1U << ((b)&7))
|
72
72
|
|
73
73
|
/* Maximum length value to check against when making sure that the integer that
|
74
74
|
holds the compiled pattern length does not overflow. We make it a bit less than
|
@@ -129,8 +129,8 @@ overrun before it actually does run off the end of the data block. */
|
|
129
129
|
|
130
130
|
/* Private flags added to firstchar and reqchar. */
|
131
131
|
|
132
|
-
#define REQ_CASELESS (
|
133
|
-
#define REQ_VARY (
|
132
|
+
#define REQ_CASELESS (1U << 0) /* Indicates caselessness */
|
133
|
+
#define REQ_VARY (1U << 1) /* Reqchar followed non-literal item */
|
134
134
|
/* Negative values for the firstchar and reqchar flags */
|
135
135
|
#define REQ_UNSET (-2)
|
136
136
|
#define REQ_NONE (-1)
|
@@ -3299,7 +3299,7 @@ for(;;)
|
|
3299
3299
|
if ((*xclass_flags & XCL_MAP) == 0)
|
3300
3300
|
{
|
3301
3301
|
/* No bits are set for characters < 256. */
|
3302
|
-
if (list[1] == 0) return
|
3302
|
+
if (list[1] == 0) return (*xclass_flags & XCL_NOT) == 0;
|
3303
3303
|
/* Might be an empty repeat. */
|
3304
3304
|
continue;
|
3305
3305
|
}
|
@@ -3611,7 +3611,7 @@ for(;;)
|
|
3611
3611
|
if (chr > 255) break;
|
3612
3612
|
class_bitset = (pcre_uint8 *)
|
3613
3613
|
((list_ptr == list ? code : base_end) - list_ptr[2]);
|
3614
|
-
if ((class_bitset[chr >> 3] & (
|
3614
|
+
if ((class_bitset[chr >> 3] & (1U << (chr & 7))) != 0) return FALSE;
|
3615
3615
|
break;
|
3616
3616
|
|
3617
3617
|
#if defined SUPPORT_UTF || !defined COMPILE_PCRE8
|
@@ -7135,17 +7135,19 @@ for (;; ptr++)
|
|
7135
7135
|
int n = 0;
|
7136
7136
|
ptr++;
|
7137
7137
|
while(IS_DIGIT(*ptr))
|
7138
|
+
{
|
7138
7139
|
n = n * 10 + *ptr++ - CHAR_0;
|
7140
|
+
if (n > 255)
|
7141
|
+
{
|
7142
|
+
*errorcodeptr = ERR38;
|
7143
|
+
goto FAILED;
|
7144
|
+
}
|
7145
|
+
}
|
7139
7146
|
if (*ptr != CHAR_RIGHT_PARENTHESIS)
|
7140
7147
|
{
|
7141
7148
|
*errorcodeptr = ERR39;
|
7142
7149
|
goto FAILED;
|
7143
7150
|
}
|
7144
|
-
if (n > 255)
|
7145
|
-
{
|
7146
|
-
*errorcodeptr = ERR38;
|
7147
|
-
goto FAILED;
|
7148
|
-
}
|
7149
7151
|
*code++ = n;
|
7150
7152
|
PUT(code, 0, (int)(ptr - cd->start_pattern + 1)); /* Pattern offset */
|
7151
7153
|
PUT(code, LINK_SIZE, 0); /* Default length */
|
@@ -7461,7 +7463,7 @@ for (;; ptr++)
|
|
7461
7463
|
{
|
7462
7464
|
open_capitem *oc;
|
7463
7465
|
recno = GET2(slot, 0);
|
7464
|
-
cd->backref_map |= (recno < 32)? (
|
7466
|
+
cd->backref_map |= (recno < 32)? (1U << recno) : 1;
|
7465
7467
|
if (recno > cd->top_backref) cd->top_backref = recno;
|
7466
7468
|
|
7467
7469
|
/* Check to see if this back reference is recursive, that it, it
|
@@ -7647,6 +7649,8 @@ for (;; ptr++)
|
|
7647
7649
|
/* Can't determine a first byte now */
|
7648
7650
|
|
7649
7651
|
if (firstcharflags == REQ_UNSET) firstcharflags = REQ_NONE;
|
7652
|
+
zerofirstchar = firstchar;
|
7653
|
+
zerofirstcharflags = firstcharflags;
|
7650
7654
|
continue;
|
7651
7655
|
|
7652
7656
|
|
@@ -8070,7 +8074,7 @@ for (;; ptr++)
|
|
8070
8074
|
item_hwm_offset = cd->hwm - cd->start_workspace;
|
8071
8075
|
*code++ = ((options & PCRE_CASELESS) != 0)? OP_REFI : OP_REF;
|
8072
8076
|
PUT2INC(code, 0, recno);
|
8073
|
-
cd->backref_map |= (recno < 32)? (
|
8077
|
+
cd->backref_map |= (recno < 32)? (1U << recno) : 1;
|
8074
8078
|
if (recno > cd->top_backref) cd->top_backref = recno;
|
8075
8079
|
|
8076
8080
|
/* Check to see if this back reference is recursive, that it, it
|
@@ -8683,14 +8687,22 @@ do {
|
|
8683
8687
|
op == OP_SCBRA || op == OP_SCBRAPOS)
|
8684
8688
|
{
|
8685
8689
|
int n = GET2(scode, 1+LINK_SIZE);
|
8686
|
-
int new_map = bracket_map | ((n < 32)? (
|
8690
|
+
int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
|
8687
8691
|
if (!is_anchored(scode, new_map, cd, atomcount)) return FALSE;
|
8688
8692
|
}
|
8689
8693
|
|
8690
|
-
/* Positive forward
|
8694
|
+
/* Positive forward assertion */
|
8695
|
+
|
8696
|
+
else if (op == OP_ASSERT)
|
8697
|
+
{
|
8698
|
+
if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
|
8699
|
+
}
|
8700
|
+
|
8701
|
+
/* Condition; not anchored if no second branch */
|
8691
8702
|
|
8692
|
-
else if (op ==
|
8703
|
+
else if (op == OP_COND)
|
8693
8704
|
{
|
8705
|
+
if (scode[GET(scode,1)] != OP_ALT) return FALSE;
|
8694
8706
|
if (!is_anchored(scode, bracket_map, cd, atomcount)) return FALSE;
|
8695
8707
|
}
|
8696
8708
|
|
@@ -8803,7 +8815,7 @@ do {
|
|
8803
8815
|
op == OP_SCBRA || op == OP_SCBRAPOS)
|
8804
8816
|
{
|
8805
8817
|
int n = GET2(scode, 1+LINK_SIZE);
|
8806
|
-
int new_map = bracket_map | ((n < 32)? (
|
8818
|
+
int new_map = bracket_map | ((n < 32)? (1U << n) : 1);
|
8807
8819
|
if (!is_startline(scode, new_map, cd, atomcount, inassert)) return FALSE;
|
8808
8820
|
}
|
8809
8821
|
|
@@ -3938,10 +3938,10 @@ static sljit_s32 character_to_int32(pcre_uchar chr)
|
|
3938
3938
|
sljit_s32 value = (sljit_s32)chr;
|
3939
3939
|
#if defined COMPILE_PCRE8
|
3940
3940
|
#define SSE2_COMPARE_TYPE_INDEX 0
|
3941
|
-
return (value << 24) | (value << 16) | (value << 8) | value;
|
3941
|
+
return ((unsigned int)value << 24) | ((unsigned int)value << 16) | ((unsigned int)value << 8) | (unsigned int)value;
|
3942
3942
|
#elif defined COMPILE_PCRE16
|
3943
3943
|
#define SSE2_COMPARE_TYPE_INDEX 1
|
3944
|
-
return (value << 16) | value;
|
3944
|
+
return ((unsigned int)value << 16) | value;
|
3945
3945
|
#elif defined COMPILE_PCRE32
|
3946
3946
|
#define SSE2_COMPARE_TYPE_INDEX 2
|
3947
3947
|
return value;
|
@@ -8507,7 +8507,7 @@ if (opcode == OP_ONCE)
|
|
8507
8507
|
/* We temporarily encode the needs_control_head in the lowest bit.
|
8508
8508
|
Note: on the target architectures of SLJIT the ((x << 1) >> 1) returns
|
8509
8509
|
the same value for small signed numbers (including negative numbers). */
|
8510
|
-
BACKTRACK_AS(bracket_backtrack)->u.framesize = (BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
|
8510
|
+
BACKTRACK_AS(bracket_backtrack)->u.framesize = ((unsigned int)BACKTRACK_AS(bracket_backtrack)->u.framesize << 1) | (needs_control_head ? 1 : 0);
|
8511
8511
|
}
|
8512
8512
|
return cc + repeat_length;
|
8513
8513
|
}
|
@@ -9002,7 +9002,7 @@ if (exact > 1)
|
|
9002
9002
|
#ifdef SUPPORT_UTF
|
9003
9003
|
&& !common->utf
|
9004
9004
|
#endif
|
9005
|
-
)
|
9005
|
+
&& type != OP_ANYNL && type != OP_EXTUNI)
|
9006
9006
|
{
|
9007
9007
|
OP2(SLJIT_ADD, TMP1, 0, STR_PTR, 0, SLJIT_IMM, IN_UCHARS(exact));
|
9008
9008
|
add_jump(compiler, &backtrack->topbacktracks, CMP(SLJIT_GREATER, TMP1, 0, STR_END, 0));
|
@@ -6,7 +6,7 @@
|
|
6
6
|
and semantics are as close as possible to those of the Perl 5 language.
|
7
7
|
|
8
8
|
Written by Philip Hazel
|
9
|
-
Copyright (c) 1997-
|
9
|
+
Copyright (c) 1997-2020 University of Cambridge
|
10
10
|
|
11
11
|
-----------------------------------------------------------------------------
|
12
12
|
Redistribution and use in source and binary forms, with or without
|
@@ -287,6 +287,7 @@ if (preg->re_pcre == NULL)
|
|
287
287
|
(void)pcre_fullinfo((const pcre *)preg->re_pcre, NULL, PCRE_INFO_CAPTURECOUNT,
|
288
288
|
&re_nsub);
|
289
289
|
preg->re_nsub = (size_t)re_nsub;
|
290
|
+
preg->re_erroffset = (size_t)(-1); /* No meaning after successful compile */
|
290
291
|
return 0;
|
291
292
|
}
|
292
293
|
|
@@ -324,8 +325,6 @@ if ((eflags & PCRE_REG_NOTBOL) != 0) options |= PCRE_NOTBOL;
|
|
324
325
|
if ((eflags & PCRE_REG_NOTEOL) != 0) options |= PCRE_NOTEOL;
|
325
326
|
if ((eflags & PCRE_REG_NOTEMPTY) != 0) options |= PCRE_NOTEMPTY;
|
326
327
|
|
327
|
-
((pcre_regex_t *)preg)->re_erroffset = (size_t)(-1); /* Only has meaning after compile */
|
328
|
-
|
329
328
|
/* When no string data is being returned, or no vector has been passed in which
|
330
329
|
to put it, ensure that nmatch is zero. Otherwise, ensure the vector for holding
|
331
330
|
the return data is large enough. */
|
@@ -1,5 +1,6 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
disable_warnings(implicit-fallthrough)
|
2
|
+
add_definitions(-DNO_VIZ -DSTDC -DNO_GZIP)
|
3
|
+
file(GLOB SRC_ZLIB "*.c" "*.h")
|
4
|
+
list(SORT SRC_ZLIB)
|
5
|
+
include_directories(".")
|
6
|
+
add_library(zlib OBJECT ${SRC_ZLIB})
|
@@ -320,6 +320,7 @@ int ZEXPORT deflateInit2_(strm, level, method, windowBits, memLevel, strategy,
|
|
320
320
|
|
321
321
|
s->window = (Bytef *) ZALLOC(strm, s->w_size, 2*sizeof(Byte));
|
322
322
|
s->prev = (Posf *) ZALLOC(strm, s->w_size, sizeof(Pos));
|
323
|
+
memset(s->prev, 0, s->w_size * sizeof(Pos));
|
323
324
|
s->head = (Posf *) ZALLOC(strm, s->hash_size, sizeof(Pos));
|
324
325
|
|
325
326
|
s->high_water = 0; /* nothing written to s->window yet */
|
@@ -78,7 +78,7 @@ GIT_EXTERN(int) git_annotated_commit_lookup(
|
|
78
78
|
const git_oid *id);
|
79
79
|
|
80
80
|
/**
|
81
|
-
* Creates a `
|
81
|
+
* Creates a `git_annotated_commit` from a revision string.
|
82
82
|
*
|
83
83
|
* See `man gitrevisions`, or
|
84
84
|
* http://git-scm.com/docs/git-rev-parse.html#_specifying_revisions for
|