Mageia Bugzilla – Attachment 6280 Details for
Bug 15558
python-dulwich new security issues CVE-2014-9706 and CVE-2015-0838
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
A Proof-of-Concept script to run.
test_pack.py (text/plain), 2.25 KB, created by
Shlomi Fish
on 2015-04-15 18:55:11 CEST
(
hide
)
Description:
A Proof-of-Concept script to run.
Filename:
MIME Type:
Creator:
Shlomi Fish
Created:
2015-04-15 18:55:11 CEST
Size:
2.25 KB
patch
obsolete
># test_pack.py -- Tests for the handling of git packs. ># Copyright (C) 2007 James Westby <jw+debian@jameswestby.net> ># Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> ># ># This program is free software; you can redistribute it and/or ># modify it under the terms of the GNU General Public License ># as published by the Free Software Foundation; version 2 ># of the License, or (at your option) any later version of the license. ># ># This program is distributed in the hope that it will be useful, ># but WITHOUT ANY WARRANTY; without even the implied warranty of ># MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ># GNU General Public License for more details. ># ># You should have received a copy of the GNU General Public License ># along with this program; if not, write to the Free Software ># Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, ># MA 02110-1301, USA. > >"""Tests for Dulwich packs.""" > > >from io import BytesIO >from hashlib import sha1 >import os >import shutil >import tempfile >import zlib > >from unittest import ( > TestCase, > ) > >import unittest > >from dulwich.pack import ( > OFS_DELTA, > REF_DELTA, > MemoryPackIndex, > Pack, > PackData, > apply_delta, > create_delta, > deltify_pack_objects, > load_pack_index, > UnpackedObject, > read_zlib_chunks, > write_pack_header, > write_pack_index_v1, > write_pack_index_v2, > write_pack_object, > write_pack, > unpack_object, > compute_file_sha, > PackStreamReader, > DeltaChainIterator, > ) > >pack1_sha = 'bc63ddad95e7321ee734ea11a7a62d314e0d7481' > >a_sha = '6f670c0fb53f9463760b7295fbb814e965fb20c8' >tree_sha = 'b2a2766a2879c209ab1176e7e778b81ae422eeaa' >commit_sha = 'f18faa16531ac570a3fdc8c7ca16682548dafd12' > >class TestPackDeltas(TestCase): > > test_string1 = 'The answer was flailing in the wind' > test_string2 = 'The answer was falling down the pipe' > test_string3 = 'zzzzz' > > test_string_empty = '' > test_string_big = 'Z' * 8192 > test_string_huge = 'Z' * 100000 > > def test_dest_overflow(self): > self.assertRaises( > ValueError, > apply_delta, 'a'*0x10000, '\x80\x80\x04\x80\x80\x04\x80' + 'a'*0x10000) > self.assertRaises( > ValueError, > apply_delta, '', '\x00\x80\x02\xb0\x11\x11') > >unittest.main(); >
# test_pack.py -- Tests for the handling of git packs. # Copyright (C) 2007 James Westby <jw+debian@jameswestby.net> # Copyright (C) 2008 Jelmer Vernooij <jelmer@samba.org> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; version 2 # of the License, or (at your option) any later version of the license. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, # MA 02110-1301, USA. """Tests for Dulwich packs.""" from io import BytesIO from hashlib import sha1 import os import shutil import tempfile import zlib from unittest import ( TestCase, ) import unittest from dulwich.pack import ( OFS_DELTA, REF_DELTA, MemoryPackIndex, Pack, PackData, apply_delta, create_delta, deltify_pack_objects, load_pack_index, UnpackedObject, read_zlib_chunks, write_pack_header, write_pack_index_v1, write_pack_index_v2, write_pack_object, write_pack, unpack_object, compute_file_sha, PackStreamReader, DeltaChainIterator, ) pack1_sha = 'bc63ddad95e7321ee734ea11a7a62d314e0d7481' a_sha = '6f670c0fb53f9463760b7295fbb814e965fb20c8' tree_sha = 'b2a2766a2879c209ab1176e7e778b81ae422eeaa' commit_sha = 'f18faa16531ac570a3fdc8c7ca16682548dafd12' class TestPackDeltas(TestCase): test_string1 = 'The answer was flailing in the wind' test_string2 = 'The answer was falling down the pipe' test_string3 = 'zzzzz' test_string_empty = '' test_string_big = 'Z' * 8192 test_string_huge = 'Z' * 100000 def test_dest_overflow(self): self.assertRaises( ValueError, apply_delta, 'a'*0x10000, '\x80\x80\x04\x80\x80\x04\x80' + 'a'*0x10000) self.assertRaises( ValueError, apply_delta, '', '\x00\x80\x02\xb0\x11\x11') unittest.main();
View Attachment As Raw
Actions:
View
Attachments on
bug 15558
: 6280