rugged 0.27.2 → 0.27.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rugged/version.rb +1 -1
- data/vendor/libgit2/include/git2/version.h +2 -2
- data/vendor/libgit2/src/delta.c +30 -28
- data/vendor/libgit2/src/transports/smart_pkt.c +8 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 075b5f14d04691ea47a585c8295f594f8db17e555401d0c34afdc1b9ee998c79
|
4
|
+
data.tar.gz: 2d38ebeef1721dbcf676e00a32471f664d8d71702a7871f6a7cf9551c1929f65
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 126a5c098f1dc094234795d8f26f4049272fdc6823e3e89a7e93afa2b6ac0583624183a0e730845e47ddfc318a3a209caac2b9af624ccce77c4e72f8ff50b8fd
|
7
|
+
data.tar.gz: 68c08ff84c4fcf0d55d8656148c605159c7582abae8f669220601e795928e571a569ddc90b7a31d1ffac31be91c19b8b8dabc41d1be5ffc51d197f1c80381c1c
|
data/lib/rugged/version.rb
CHANGED
@@ -7,10 +7,10 @@
|
|
7
7
|
#ifndef INCLUDE_git_version_h__
|
8
8
|
#define INCLUDE_git_version_h__
|
9
9
|
|
10
|
-
#define LIBGIT2_VERSION "0.27.
|
10
|
+
#define LIBGIT2_VERSION "0.27.4"
|
11
11
|
#define LIBGIT2_VER_MAJOR 0
|
12
12
|
#define LIBGIT2_VER_MINOR 27
|
13
|
-
#define LIBGIT2_VER_REVISION
|
13
|
+
#define LIBGIT2_VER_REVISION 4
|
14
14
|
#define LIBGIT2_VER_PATCH 0
|
15
15
|
|
16
16
|
#define LIBGIT2_SOVERSION 27
|
data/vendor/libgit2/src/delta.c
CHANGED
@@ -539,10 +539,11 @@ int git_delta_apply(
|
|
539
539
|
*out = NULL;
|
540
540
|
*out_len = 0;
|
541
541
|
|
542
|
-
/*
|
543
|
-
|
544
|
-
|
545
|
-
|
542
|
+
/*
|
543
|
+
* Check that the base size matches the data we were given;
|
544
|
+
* if not we would underflow while accessing data from the
|
545
|
+
* base object, resulting in data corruption or segfault.
|
546
|
+
*/
|
546
547
|
if ((hdr_sz(&base_sz, &delta, delta_end) < 0) || (base_sz != base_len)) {
|
547
548
|
giterr_set(GITERR_INVALID, "failed to apply delta: base size does not match given data");
|
548
549
|
return -1;
|
@@ -564,31 +565,34 @@ int git_delta_apply(
|
|
564
565
|
while (delta < delta_end) {
|
565
566
|
unsigned char cmd = *delta++;
|
566
567
|
if (cmd & 0x80) {
|
567
|
-
/* cmd is a copy instruction; copy from the base.
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
if (cmd & 0x01) off
|
572
|
-
if (cmd & 0x02) off
|
573
|
-
if (cmd & 0x04) off
|
574
|
-
if (cmd & 0x08) off
|
575
|
-
|
576
|
-
if (cmd & 0x10) len
|
577
|
-
if (cmd & 0x20) len
|
578
|
-
if (cmd & 0x40) len
|
579
|
-
if (!len)
|
580
|
-
|
581
|
-
|
568
|
+
/* cmd is a copy instruction; copy from the base. */
|
569
|
+
size_t off = 0, len = 0, end;
|
570
|
+
|
571
|
+
#define ADD_DELTA(o, shift) { if (delta < delta_end) (o) |= ((unsigned) *delta++ << shift); else goto fail; }
|
572
|
+
if (cmd & 0x01) ADD_DELTA(off, 0UL);
|
573
|
+
if (cmd & 0x02) ADD_DELTA(off, 8UL);
|
574
|
+
if (cmd & 0x04) ADD_DELTA(off, 16UL);
|
575
|
+
if (cmd & 0x08) ADD_DELTA(off, 24UL);
|
576
|
+
|
577
|
+
if (cmd & 0x10) ADD_DELTA(len, 0UL);
|
578
|
+
if (cmd & 0x20) ADD_DELTA(len, 8UL);
|
579
|
+
if (cmd & 0x40) ADD_DELTA(len, 16UL);
|
580
|
+
if (!len) len = 0x10000;
|
581
|
+
#undef ADD_DELTA
|
582
|
+
|
583
|
+
if (GIT_ADD_SIZET_OVERFLOW(&end, off, len) ||
|
584
|
+
base_len < end || res_sz < len)
|
582
585
|
goto fail;
|
586
|
+
|
583
587
|
memcpy(res_dp, base + off, len);
|
584
588
|
res_dp += len;
|
585
589
|
res_sz -= len;
|
586
590
|
|
587
|
-
}
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
591
|
+
} else if (cmd) {
|
592
|
+
/*
|
593
|
+
* cmd is a literal insert instruction; copy from
|
594
|
+
* the delta stream itself.
|
595
|
+
*/
|
592
596
|
if (delta_end - delta < cmd || res_sz < cmd)
|
593
597
|
goto fail;
|
594
598
|
memcpy(res_dp, delta, cmd);
|
@@ -596,10 +600,8 @@ int git_delta_apply(
|
|
596
600
|
res_dp += cmd;
|
597
601
|
res_sz -= cmd;
|
598
602
|
|
599
|
-
}
|
600
|
-
|
601
|
-
/* cmd == 0 is reserved for future encodings.
|
602
|
-
*/
|
603
|
+
} else {
|
604
|
+
/* cmd == 0 is reserved for future encodings. */
|
603
605
|
goto fail;
|
604
606
|
}
|
605
607
|
}
|
@@ -299,8 +299,11 @@ static int ng_pkt(git_pkt **out, const char *line, size_t len)
|
|
299
299
|
pkt->ref = NULL;
|
300
300
|
pkt->type = GIT_PKT_NG;
|
301
301
|
|
302
|
+
if (len < 3)
|
303
|
+
goto out_err;
|
302
304
|
line += 3; /* skip "ng " */
|
303
|
-
|
305
|
+
len -= 3;
|
306
|
+
if (!(ptr = memchr(line, ' ', len)))
|
304
307
|
goto out_err;
|
305
308
|
len = ptr - line;
|
306
309
|
|
@@ -311,8 +314,11 @@ static int ng_pkt(git_pkt **out, const char *line, size_t len)
|
|
311
314
|
memcpy(pkt->ref, line, len);
|
312
315
|
pkt->ref[len] = '\0';
|
313
316
|
|
317
|
+
if (len < 1)
|
318
|
+
goto out_err;
|
314
319
|
line = ptr + 1;
|
315
|
-
|
320
|
+
len -= 1;
|
321
|
+
if (!(ptr = memchr(line, '\n', len)))
|
316
322
|
goto out_err;
|
317
323
|
len = ptr - line;
|
318
324
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rugged
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.27.
|
4
|
+
version: 0.27.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Scott Chacon
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2018-
|
12
|
+
date: 2018-08-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake-compiler
|