From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Chris Gregory Newsgroups: gmane.emacs.devel Subject: Reformat all of src/ Date: Tue, 27 Dec 2016 18:59:59 -0600 Message-ID: <87h95olvg0.fsf@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1482895745 18177 195.159.176.226 (28 Dec 2016 03:29:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 28 Dec 2016 03:29:05 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Dec 28 04:26:05 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cM4sE-00029B-RW for ged-emacs-devel@m.gmane.org; Wed, 28 Dec 2016 04:25:59 +0100 Original-Received: from localhost ([::1]:57156 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cM4sI-0005Nb-4Z for ged-emacs-devel@m.gmane.org; Tue, 27 Dec 2016 22:25:58 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57149) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cM2bC-0003pX-Ml for emacs-devel@gnu.org; Tue, 27 Dec 2016 20:00:12 -0500 Original-Received: from mail-it0-x236.google.com ([2607:f8b0:4001:c0b::236]:38571) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cM2bB-0007qR-EA for emacs-devel@gnu.org; Tue, 27 Dec 2016 20:00:10 -0500 Original-Received: by mail-it0-x236.google.com with SMTP id x2so180061850itf.1 for ; Tue, 27 Dec 2016 17:00:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version; bh=pTIYNpNdV6bxHdTrgu4l9j99YgFXlbLX99GtOUwNfJg=; b=KUSgipgCFghmXDjOCQZqCV0mxqIEVO/usg7qZQtgYsyiVNhLFYv3OP/GySrG4UvCy0 GETbS23iCrQijmUgUQx8tcvPo8CbYQBpzgpJFQ0YGxAvU1O53ZYtsGGfzpA1wgnzqJII D1K9u7J4AC+qq7EN6Y545uIPspAq/I31P4vmmhAwmyIkMfdwYoKl5SZnOJ/fR3qDfwRx PO04q+bS1rslrWDIt62vspcIamdaZvjfaeQzLVCktePgPUBPkj4yPwEuefBG0rqkg70f o8hCbyRoYJPogvsS/Q0rz8OT0nBm1e2vnkOzIK1awkCbNZJaiIyxDPpS5xL830ROH+Dk 7l1w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:mime-version; bh=pTIYNpNdV6bxHdTrgu4l9j99YgFXlbLX99GtOUwNfJg=; b=fRc7yw+fOwsd5qyuTyue9wIa1+SdFll0+5K0Nt9edTMKg+gpttLgSmg/t8cN+YcVH8 ERpFFH4vurpRNMpLyfQr94C5Zk7Sb2vu8Bcr5XJ6TwxWQsWoXLAjfbxOYGGJzHyQOuvk dirbITWeMYdM+I3j1Ik6u9zfqlK6zoOfXS+FCaW4sGtI9K1P3cRlQ33YS7vtq6PaBqtF Wu1GCA2gEeJuHrPAKg6i9/1L2SsIMCqXcRsGPzIGBRj2at1x0xfTOvahdf4DzSEkQZF2 0HXyo1EByHZe7KajKqIzko/AMBAfIErJEZxl0sAEmFnqJ3S61wKKAJHcd2ioEnmcH+vN gm4Q== X-Gm-Message-State: AIkVDXIwO+ga6PUSIIrbS5S0Zjtf5qfo88GcNhPIZJoVGoubOh/tYgt/lSjuLKBMy+69rw== X-Received: by 10.36.200.10 with SMTP id w10mr26076935itf.21.1482886808325; Tue, 27 Dec 2016 17:00:08 -0800 (PST) Original-Received: from CzipperZag ([2604:2d80:8039:81de:a0b5:3d06:3bb2:d546]) by smtp.gmail.com with ESMTPSA id x64sm11428093ioi.36.2016.12.27.17.00.06 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 27 Dec 2016 17:00:06 -0800 (PST) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Mailman-Approved-At: Tue, 27 Dec 2016 22:25:41 -0500 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:210862 Archived-At: --=-=-= Content-Type: text/plain I found it irritating that there was inconsistent usage of tabs and spaces at the beginning of lines. So I reformatted the entirety of the src directory such that all lines that begin with 8 spaces now begin with tabs, and all lines that begin with 1 tab and 8 spaces now begin with 2 tabs, and so on. Here was the bash command I used for future reference (run it about 10 times): $ find src -name '*.c' -o -name '*.h' | xargs perl -pe 's/^(\t*) {8}/$1\t/' -i Diff is attached. It is rather large. --=-=-= Content-Type: application/octet-stream Content-Disposition: attachment; filename=diff Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL3NyYy9hbGxvYy5jIGIvc3JjL2FsbG9jLmMKaW5kZXggMTIxZDcwNC4uYTdh OTBmNCAxMDA2NDQKLS0tIGEvc3JjL2FsbG9jLmMKKysrIGIvc3JjL2FsbG9jLmMKQEAgLTEyNjEs NyArMTI2MSw3IEBAIGxpc3BfYWxpZ25fbWFsbG9jIChzaXplX3QgbmJ5dGVzLCBlbnVtIG1lbV90 eXBlIHR5cGUpCiAKICNpZmRlZiBET1VHX0xFQV9NQUxMT0MKICAgICAgIGlmICghbW1hcF9saXNw X2FsbG93ZWRfcCAoKSkKLSAgICAgICAgbWFsbG9w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WNzX2Fib3J0ICgpOworCWVtYWNzX2Fib3J0ICgpOwogCiAgICAgICBjb25z aW5nX3NpbmNlX2djICs9IG5ieXRlczsKICAgICAgIHZlY3Rvcl9jZWxsc19jb25zZWQgKz0gbGVu OwpAQCAtMzkzNyw3ICszOTM3LDcgQEAgaW5pdF9maW5hbGl6ZXJfbGlzdCAoc3RydWN0IExpc3Bf RmluYWxpemVyICpoZWFkKQogCiBzdGF0aWMgdm9pZAogZmluYWxpemVyX2luc2VydCAoc3RydWN0 IExpc3BfRmluYWxpemVyICplbGVtZW50LAotICAgICAgICAgICAgICAgICAgc3RydWN0IExpc3Bf RmluYWxpemVyICpmaW5hbGl6ZXIpCisJCSAgc3RydWN0IExpc3BfRmluYWxpemVyICpmaW5hbGl6 ZXIpCiB7CiAgIGVhc3NlcnQgKGZpbmFsaXplci0+cHJldiA9PSBOVUxMKTsKICAgZWFzc2VydCAo ZmluYWxpemVyLT5uZXh0ID09IE5VTEwpOwpAQCAtMzk3NywxNyArMzk3NywxNyBAQCBtYXJrX2Zp bmFsaXplcl9saXN0IChzdHJ1Y3QgTGlzcF9GaW5hbGl6ZXIgKmhlYWQpCiAKIHN0YXRpYyB2b2lk CiBxdWV1ZV9kb29tZWRfZmluYWxpemVycyAoc3RydWN0IExpc3BfRmluYWxpemVyICpkZXN0LAot ICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBMaXNwX0ZpbmFsaXplciAqc3JjKQorCQkJ IHN0cnVjdCBMaXNwX0ZpbmFsaXplciAqc3JjKQogewogICBzdHJ1Y3QgTGlzcF9GaW5hbGl6ZXIg KmZpbmFsaXplciA9IHNyYy0+bmV4dDsKICAgd2hpbGUgKGZpbmFsaXplciAhPSBzcmMpCiAgICAg ewogICAgICAgc3RydWN0IExpc3BfRmluYWxpemVyICpuZXh0ID0gZmluYWxpemVyLT5uZXh0Owog ICAgICAgaWYgKCFmaW5hbGl6ZXItPmJhc2UuZ2NtYXJrYml0ICYmICFOSUxQIChmaW5h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N0IG1lbV9ub2RlICp3ID0geC0+cGFyZW50LT5s ZWZ0OwpAQCAtNDUwMiwxMyArNDUwMiwxMyBAQCBtZW1fZGVsZXRlX2ZpeHVwIChzdHJ1Y3QgbWVt X25vZGUgKngpCiAJICAgICAgeC0+cGFyZW50LT5jb2xvciA9IE1FTV9SRUQ7CiAJICAgICAgbWVt X3JvdGF0ZV9yaWdodCAoeC0+cGFyZW50KTsKIAkgICAgICB3ID0geC0+cGFyZW50LT5sZWZ0Owot ICAgICAgICAgICAgfQorCSAgICB9CiAKIAkgIGlmICh3LT5yaWdodC0+Y29sb3IgPT0gTUVNX0JM QUNLICYmIHctPmxlZnQtPmNvbG9yID09IE1FTV9CTEFDSykKIAkgICAgewogCSAgICAgIHctPmNv bG9yID0gTUVNX1JFRDsKIAkgICAgICB4ID0geC0+cGFyZW50OwotICAgICAgICAgICAgfQorCSAg ICB9CiAJICBlbHNlCiAJICAgIHsKIAkgICAgICBpZiAody0+bGVmdC0+Y29sb3IgPT0gTUVNX0JM QUNLKQpAQCAtNDUxNywxNSArNDUxNywxNSBAQCBtZW1fZGVsZXRlX2ZpeHVwIChzdHJ1Y3QgbWVt X25vZGUgKngpCiAJCSAgdy0+Y29sb3IgPSBNRU1fUkVEOwogCQkgIG1lbV9yb3RhdGVfbGVmdCAo dyk7CiAJCSAgdyA9IHgtPnBhcmVudC0+bGVmdDsKLSAgICAgICAgICAgICAgICB9CisJCX0KIAog CSAgICAgIHctPmNvbG9yID0geC0+cGFyZW50LT5jb2xvcjsKIAkgICAgICB4LT5wYXJlbnQtPmNv bG9yID0gTUVNX0JMQUNLOwogCSAgICAgIHctPmxlZnQtPmNvbG9yID0gTUVNX0JMQUNLOwogCSAg ICAgIG1lbV9yb3RhdGVfcmlnaHQgKHgtPnBhcmVudCk7CiAJICAgICAgeCA9IG1lbV9yb290Owot ICAgICAgICAgICAgfQotICAgICAgICB9CisJICAgIH0KKwl9CiAgICAgfQogCiAgIHgtPmNvbG9y ID0gTUVNX0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gdGhlIHNldGptcCBqdXN0IGRpZG4ndCBzYXZlIHRoZSByZWdp c3Rlci4gICovCisJIEZvciBvdGhlciB2YWx1ZXMgb2YgWCwgZWl0aGVyIHNvbWV0aGluZyByZWFs bHkgc3RyYW5nZSBpcworCSB0YWtpbmcgcGxhY2UsIG9yIHRoZSBzZXRqbXAganVzdCBkaWRuJ3Qg c2F2ZSB0aGUgcmVnaXN0ZXIuICAqLwogCiAgICAgICBpZiAoeCA9PSAxKQogCWZwcmludGYgKHN0 ZGVyciwgU0VUSk1QX1dJTExfTElLRUxZX1dPUkspOwpAQCAtNTYzMywyOCArNTYzMywyOCBAQCBj b21wYWN0X2ZvbnRfY2FjaGVfZW50cnkgKExpc3BfT2JqZWN0IGVudHJ5KQogCSAgICAgYXJlIG5v dCBtYXJrZWQgdG9vLiAgQnV0IHdlIG11c3QgYmUgc3VyZSB0aGF0IG5vdGhpbmcgaXMKIAkgICAg IG1hcmtlZCB3aXRoaW4gT0JKIGJlZm9yZSB3ZSByZWFsbHkgZHJvcCBpdC4gICovCiAJICBmb3Ig KGkgPSAwOyBpIDwgc2l6ZTsgaSsrKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBMaXNw X09iamVjdCBvYmpsaXN0OwotCi0gICAgICAgICAgICAgIGlmIChWRUNUT1JfTUFSS0VEX1AgKEdD X1hGT05UX0VOVElUWSAoQVJFRiAob2JqX2NkciwgaSkpKSkKLSAgICAgICAgICAgICAgICBicmVh azsKLQotICAgICAgICAgICAgICBvYmpsaXN0ID0gQVJFRiAoQVJFRiAob2JqX2NkciwgaSksIEZP TlRfT0JKTElTVF9JTkRFWCk7Ci0gICAgICAgICAgICAgIGZvciAoOyBDT05TUCAob2JqbGlzdCk7 IG9iamxpc3QgPSBYQ0RSIChvYmpsaXN0KSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgICAgICBMaXNwX09iamVjdCB2YWwgPSBYQ0FSIChvYmpsaXN0KTsKLSAgICAgICAgICAgICAg ICAgIHN0cnVjdCBmb250ICpmb250ID0gR0NfWEZPTlRfT0JKRUNUICh2YWwpOwotCi0gICAgICAg ICAgICAgICAgICBpZiAoIU5JTFAgKEFSRUYgKHZhbCwgRk9OVF9UWVBFX0lOREVYKSkKLSAgICAg ICAgICAgICAgICAgICAgICAmJiBWRUNUT1JfTUFSS0VEX1AoZm9udCkpCi0gICAgICAgICAgICAg ICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgaWYgKENPTlNQ IChvYmpsaXN0KSkKKwkgICAgeworCSAgICAgIExpc3BfT2JqZWN0IG9iamxpc3Q7CisKKwkgICAg ICBpZiAoVkVDVE9SX01BUktFRF9QIChHQ19YRk9OVF9FTlRJVFkgKEFSRUYgKG9ial9jZHIsIGkp KSkpCisJCWJyZWFrOworCisJICAgICAgb2JqbGlzdCA9IEFSRUYgKEFSRUYgKG9ial9jZHIsIGkp LCBGT05UX09CSkxJU1RfSU5ERVgpOworCSAgICAgIGZvciAoOyBDT05TUCAob2JqbGlzdCk7IG9i amxpc3QgPSBYQ0RSIChvYmpsaXN0KSkKKwkJeworCQkgIExpc3BfT2JqZWN0IHZhbCA9IFhDQVIg KG9iamxpc3QpOworCQkgIHN0cnVjdCBmb250ICpmb250ID0gR0NfWEZPTlRfT0JKRUNUICh2YWwp OworCisJCSAgaWYgKCFOSUxQIChBUkVGICh2YWwsIEZPTlRfVFlQRV9JTkRFWCkpCisJCSAgICAg ICYmIFZFQ1RPUl9NQVJLRURfUChmb250KSkKKwkJICAgIGJyZWFrOworCQl9CisJICAgICAgaWYg KENPTlNQIChvYmpsaXN0KSkKIAkJewogCQkgIC8qIEZvdW5kIGEgbWFya2VkIGZvbnQsIGJhaWwg b3V0LiAgKi8KIAkJICBicmVhazsKIAkJfQotICAgICAgICAgICAgfQorCSAgICB9CiAKIAkgIGlm IChpID09IHNpemUpCiAJICAgIHsKQEAgLTY1MzcsNyArNjUzNyw3IEBAIG1hcmtfb2JqZWN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VwX2NvbnNlcyAodm9pZCkKIAogICAgICAgLyogU2NhbiB0aGUgbWFyayBiaXRzIGFu IGludCBhdCBhIHRpbWUuICAqLwogICAgICAgZm9yIChpID0gMDsgaSA8IGlsaW07IGkrKykKLSAg ICAgICAgewotICAgICAgICAgIGlmIChjYmxrLT5nY21hcmtiaXRzW2ldID09IEJJVFNfV09SRF9N QVgpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIC8qIEZhc3QgcGF0aCAtIGFsbCBjb25z IGNlbGxzIGZvciB0aGlzIGludCBhcmUgbWFya2VkLiAgKi8KLSAgICAgICAgICAgICAgY2Jsay0+ Z2NtYXJrYml0c1tpXSA9IDA7Ci0gICAgICAgICAgICAgIG51bV91c2VkICs9IEJJVFNfUEVSX0JJ VFNfV09SRDsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0g ICAgICAgICAgICAgIC8qIFNvbWUgY29ucyBjZWxscyBmb3IgdGhpcyBpbnQgYXJlIG5vdCBtYXJr ZWQuCi0gICAgICAgICAgICAgICAgIEZpbmQgd2hpY2ggb25lcywgYW5kIGZyZWUgdGhlbS4gICov Ci0gICAgICAgICAgICAgIGludCBzdGFydCwgcG9zLCBzdG9wOwotCi0gICAgICAgICAgICAgIHN0 YXJ0ID0gaSAqIEJJVFNfUEVSX0JJVFNfV09SRDsKLSAgICAgICAgICAgICAgc3RvcCA9IGxpbSAt IHN0YXJ0OwotICAgICAgICAgICAgICBpZiAoc3RvcCA+IEJJVFNfUEVSX0JJVFNfV09SRCkKLSAg ICAgICAgICAgICAgICBzdG9wID0gQklUU19QRVJfQklUU19XT1JEOwotICAgICAgICAgICAgICBz dG9wICs9IHN0YXJ0OwotCi0gICAgICAgICAgICAgIGZvciAocG9zID0gc3RhcnQ7IHBvcyA8IHN0 b3A7IHBvcysrKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGlmICghQ09O U19NQVJLRURfUCAoJmNibGstPmNvbnNlc1twb3NdKSkKLSAgICAgICAgICAgICAgICAgICAgewot ICAgICAgICAgICAgICAgICAgICAgIHRoaXNfZnJlZSsrOwotICAgICAgICAgICAgICAgICAgICAg IGNibGstPmNvbnNlc1twb3NdLnUuY2hhaW4gPSBjb25zX2ZyZWVfbGlzdDsKLSAgICAgICAgICAg ICAgICAgICAgICBjb25zX2ZyZWVfbGlzdCA9ICZjYmxrLT5jb25zZXNbcG9zXTsKLSAgICAgICAg ICAgICAgICAgICAgICBjb25zX2ZyZWVfbGlzdC0+Y2FyID0gVmRlYWQ7Ci0gICAgICAgICAgICAg ICAgICAgIH0KLSAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewot ICAgICAgICAgICAgICAgICAgICAgIG51bV91c2VkKys7Ci0gICAgICAgICAgICAgICAgICAgICAg Q09OU19VTk1BUksgKCZjYmxrLT5jb25zZXNbcG9zXSk7Ci0gICAgICAgICAgICAgICAgICAgIH0K LSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJICBpZiAo Y2Jsay0+Z2NtYXJrYml0c1tpXSA9PSBCSVRTX1dPUkRfTUFYKQorCSAgICB7CisJICAgICAgLyog RmFzdCBwYXRoIC0gYWxsIGNvbnMgY2VsbHMgZm9yIHRoaXMgaW50IGFyZSBtYXJrZWQuICAqLwor CSAgICAgIGNibGstPmdjbWFya2JpdHNbaV0gPSAwOworCSAgICAgIG51bV91c2VkICs9IEJJVFNf UEVSX0JJVFNfV09SRDsKKwkgICAgfQorCSAgZWxzZQorCSAgICB7CisJICAgICAgLyogU29tZSBj b25zIGNlbGxzIGZvciB0aGlzIGludCBhcmUgbm90IG1hcmtlZC4KKwkJIEZpbmQgd2hpY2ggb25l cywgYW5kIGZyZWUgdGhlbS4gICovCisJICAgICAgaW50IHN0YXJ0LCBwb3MsIHN0b3A7CisKKwkg ICAgICBzdGFydCA9IGkgKiBCSVRTX1BFUl9CSVRTX1dPUkQ7CisJICAgICAgc3RvcCA9IGxpbSAt IHN0YXJ0OworCSAgICAgIGlmIChzdG9wID4gQklUU19QRVJfQklUU19XT1JEKQorCQlzdG9wID0g QklUU19QRVJfQklUU19XT1JEOworCSAgICAgIHN0b3AgKz0gc3RhcnQ7CisKKwkgICAgICBmb3Ig KHBvcyA9IHN0YXJ0OyBwb3MgPCBzdG9wOyBwb3MrKykKKwkJeworCQkgIGlmICghQ09OU19NQVJL RURfUCAoJmNibGstPmNvbnNlc1twb3NdKSkKKwkJICAgIHsKKwkJICAgICAgdGhpc19mcmVlKys7 CisJCSAgICAgIGNibGstPmNvbnNlc1twb3NdLnUuY2hhaW4gPSBjb25zX2ZyZWVfbGlzdDsKKwkJ ICAgICAgY29uc19mcmVlX2xpc3QgPSAmY2Jsay0+Y29uc2VzW3Bvc107CisJCSAgICAgIGNvbnNf ZnJlZV9saXN0LT5jYXIgPSBWZGVhZDsKKwkJICAgIH0KKwkJICBlbHNlCisJCSAgICB7CisJCSAg ICAgIG51bV91c2VkKys7CisJCSAgICAgIENPTlNfVU5NQVJLICgmY2Jsay0+Y29uc2VzW3Bvc10p OworCQkgICAgfQorCQl9CisJICAgIH0KKwl9CiAKICAgICAgIGxpbSA9IENPTlNfQkxPQ0tfU0la RTsKICAgICAgIC8qIElmIHRoaXMgYmxvY2sgY29udGFpbnMgb25seSBmcmVlIGNvbnNlcyBhbmQg d2UgaGF2ZSBhbHJlYWR5Ci0gICAgICAgICBzZWVuIG1vcmUgdGhhbiB0d28gYmxvY2tzIHdvcnRo IG9mIGZyZWUgY29uc2VzIHRoZW4gZGVhbGxvY2F0ZQotICAgICAgICAgdGhpcyBibG9jay4gICov CisJIHNlZW4gbW9yZSB0aGFuIHR3byBibG9ja3Mgd29ydGggb2YgZnJlZSBjb25zZXMgdGhlbiBk ZWFsbG9jYXRlCisJIHRoaXMgYmxvY2suICAqLwogICAgICAgaWYgKHRoaXNfZnJlZSA9PSBDT05T X0JMT0NLX1NJWkUgJiYgbnVtX2ZyZWUgPiBDT05TX0JMT0NLX1NJWkUpCi0gICAgICAgIHsKLSAg ICAgICAgICAqY3ByZXYgPSBjYmxrLT5uZXh0OwotICAgICAgICAgIC8qIFVuaG9vayBmcm9tIHRo ZSBmcmVlIGxpc3QuICAqLwotICAgICAgICAgIGNvbnNfZnJlZV9saXN0ID0gY2Jsay0+Y29uc2Vz WzBdLnUuY2hhaW47Ci0gICAgICAgICAgbGlzcF9hbGlnbl9mcmVlIChjYmxrKTsKLSAgICAgICAg fQorCXsKKwkgICpjcHJldiA9IGNibGstPm5leHQ7CisJICAvKiBVbmhvb2sgZnJvbSB0aGUgZnJl ZSBsaXN0LiAgKi8KKwkgIGNvbnNfZnJlZV9saXN0ID0gY2Jsay0+Y29uc2VzWzBdLnUuY2hhaW47 CisJICBsaXNwX2FsaWduX2ZyZWUgKGNibGspOworCX0KICAgICAgIGVsc2UKLSAgICAgICAgewot ICAgICAgICAgIG51bV9mcmVlICs9IHRoaXNfZnJlZTsKLSAgICAgICAgICBjcHJldiA9ICZjYmxr LT5uZXh0OwotICAgICAgICB9CisJeworCSAgbnVtX2ZyZWUgKz0gdGhpc19mcmVlOworCSAgY3By ZXYgPSAmY2Jsay0+bmV4dDsKKwl9CiAgICAgfQogICB0b3RhbF9jb25zZXMgPSBudW1fdXNlZDsK ICAgdG90YWxfZnJlZV9jb25zZXMgPSBudW1fZnJlZTsKQEAgLTY4MTMsMzMgKzY4MTMsMzMgQEAg c3dlZXBfZmxvYXRzICh2b2lkKQogICAgICAgcmVnaXN0ZXIgaW50IGk7CiAgICAgICBpbnQgdGhp c19mcmVlID0gMDsKICAgICAgIGZvciAoaSA9IDA7IGkgPCBsaW07IGkrKykKLSAgICAgICAgaWYg KCFGTE9BVF9NQVJLRURfUCAoJmZibGstPmZsb2F0c1tpXSkpCi0gICAgICAgICAgewotICAgICAg ICAgICAgdGhpc19mcmVlKys7Ci0gICAgICAgICAgICBmYmxrLT5mbG9hdHNbaV0udS5jaGFpbiA9 IGZsb2F0X2ZyZWVfbGlzdDsKLSAgICAgICAgICAgIGZsb2F0X2ZyZWVfbGlzdCA9ICZmYmxrLT5m bG9hdHNbaV07Ci0gICAgICAgICAgfQotICAgICAgICBlbHNlCi0gICAgICAgICAgewotICAgICAg ICAgICAgbnVtX3VzZWQrKzsKLSAgICAgICAgICAgIEZMT0FUX1VOTUFSSyAoJmZibGstPmZsb2F0 c1tpXSk7Ci0gICAgICAgICAgfQorCWlmICghRkxPQVRfTUFSS0VEX1AgKCZmYmxrLT5mbG9hdHNb aV0pKQorCSAgeworCSAgICB0aGlzX2ZyZWUrKzsKKwkgICAgZmJsay0+ZmxvYXRzW2ldLnUuY2hh aW4gPSBmbG9hdF9mcmVlX2xpc3Q7CisJICAgIGZsb2F0X2ZyZWVfbGlzdCA9ICZmYmxrLT5mbG9h dHNbaV07CisJICB9CisJZWxzZQorCSAgeworCSAgICBudW1fdXNlZCsrOworCSAgICBGTE9BVF9V Tk1BUksgKCZmYmxrLT5mbG9hdHNbaV0pOworCSAgfQogICAgICAgbGltID0gRkxPQVRfQkxPQ0tf U0laRTsKICAgICAgIC8qIElmIHRoaXMgYmxvY2sgY29udGFpbnMgb25seSBmcmVlIGZsb2F0cyBh bmQgd2UgaGF2ZSBhbHJlYWR5Ci0gICAgICAgICBzZWVuIG1vcmUgdGhhbiB0d28gYmxvY2tzIHdv cnRoIG9mIGZyZWUgZmxvYXRzIHRoZW4gZGVhbGxvY2F0ZQotICAgICAgICAgdGhpcyBibG9jay4g ICovCisJIHNlZW4gbW9yZSB0aGFuIHR3byBibG9ja3Mgd29ydGggb2YgZnJlZSBmbG9hdHMgdGhl biBkZWFsbG9jYXRlCisJIHRoaXMgYmxvY2suICAqLwogICAgICAgaWYgKHRoaXNfZnJlZSA9PSBG TE9BVF9CTE9DS19TSVpFICYmIG51bV9mcmVlID4gRkxPQVRfQkxPQ0tfU0laRSkKLSAgICAgICAg ewotICAgICAgICAgICpmcHJldiA9IGZibGstPm5leH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NbaV07Ci0gICAgICAgICAgICAgIHRoaXNfZnJlZSsrOwotICAgICAgICAgICAgfQot ICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgbnVtX3VzZWQrKzsK LSAgICAgICAgICAgICAgaWJsay0+aW50ZXJ2YWxzW2ldLmdjbWFya2JpdCA9IDA7Ci0gICAgICAg ICAgICB9Ci0gICAgICAgIH0KKwl7CisJICBpZiAoIWlibGstPmludGVydmFsc1tpXS5nY21hcmti aXQpCisJICAgIHsKKwkgICAgICBzZXRfaW50ZXJ2YWxfcGFyZW50ICgmaWJsay0+aW50ZXJ2YWxz W2ldLCBpbnRlcnZhbF9mcmVlX2xpc3QpOworCSAgICAgIGludGVydmFsX2ZyZWVfbGlzdCA9ICZp YmxrLT5pbnRlcnZhbHNbaV07CisJICAgICAgdGhpc19mcmVlKys7CisJICAgIH0KKwkgIGVsc2UK KwkgICAgeworCSAgICAgIG51bV91c2VkKys7CisJICAgICAgaWJsay0+aW50ZXJ2YWxzW2ldLmdj bWFya2JpdCA9IDA7CisJICAgIH0KKwl9CiAgICAgICBsaW0gPSBJTlRFUlZBTF9CTE9DS19TSVpF OwogICAgICAgLyogSWYgdGhpcyBibG9jayBjb250YWlucyBvbmx5IGZyZWUgaW50ZXJ2YWxzIGFu ZCB3ZSBoYXZlIGFscmVhZHkKLSAgICAgICAgIHNlZW4gbW9yZSB0aGFuIHR3byBibG9ja3Mgd29y dGggb2YgZnJlZSBpbnRlcnZhbHMgdGhlbgotICAgICAgICAgZGVhbGxvY2F0ZSB0aGlzIGJsb2Nr LiAgKi8KKwkgc2VlbiBtb3JlIHRoYW4gdHdvIGJsb2NrcyB3b3J0aCBvZiBmcmVlIGludGVydmFs cyB0aGVuCisJIGRlYWxsb2NhdGUgdGhpcyBibG9jay4gICovCiAgICAgICBpZiAodGhpc19mcmVl ID09IElOVEVSVkFMX0JMT0NLX1NJWkUgJiYgbnVtX2ZyZWUgPiBJTlRFUlZBTF9CTE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IFNZTUJPTF9MT0NBTElaRUQpCi0gICAgICAgICAgICAgICAg eGZyZWUgKFNZTUJPTF9CTFYgKCZzeW0tPnMpKTsKLSAgICAgICAgICAgICAgc3ltLT5zLm5leHQg PSBzeW1ib2xfZnJlZV9saXN0OwotICAgICAgICAgICAgICBzeW1ib2xfZnJlZV9saXN0ID0gJnN5 bS0+czsKLSAgICAgICAgICAgICAgc3ltYm9sX2ZyZWVfbGlzdC0+ZnVuY3Rpb24gPSBWZGVhZDsK LSAgICAgICAgICAgICAgKyt0aGlzX2ZyZWU7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZWxz ZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICArK251bV91c2VkOwotICAgICAgICAgICAg ICBzeW0tPnMuZ2NtYXJrYml0ID0gMDsKLSAgICAgICAgICAgICAgLyogQXR0ZW1wdCB0byBjYXRj aCBib2d1cyBvYmplY3RzLiAgKi8KLSAgICAgICAgICAgICAgZWFzc2VydCAodmFsaWRfbGlzcF9v YmplY3RfcCAoc3ltLT5zLmZ1bmN0aW9uKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7 CisJICBpZiAoIXN5bS0+cy5nY21hcmtiaXQpCisJICAgIHsKKwkgICAgICBpZiAoc3ltLT5zLnJl ZGlyZWN0ID09IFNZTUJPTF9MT0NBTElaRUQpCisJCXhmcmVlIChTWU1CT0xfQkxWICgmc3ltLT5z KSk7CisJICAgICAgc3ltLT5zLm5leHQgPSBzeW1ib2xfZnJlZV9saXN0OworCSAgICAgIHN5bWJv bF9mcmVlX2xpc3QgPSAmc3ltLT5zOworCSAgICAgIHN5bWJvbF9mcmVlX2xpc3QtPmZ1bmN0aW9u ID0gVmRlYWQ7CisJICAgICAgKyt0aGlzX2ZyZWU7CisJICAgIH0KKwkgIGVsc2UKKwkgICAgewor CSAgICAgICsrbnVtX3VzZWQ7CisJICAgICAgc3ltLT5zLmdjbWFya2JpdCA9IDA7CisJICAgICAg LyogQXR0ZW1w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cmVlICs9IHRoaXNfZnJlZTsK LSAgICAgICAgICBzcHJldiA9ICZzYmxrLT5uZXh0OwotICAgICAgICB9CisJeworCSAgbnVtX2Zy ZWUgKz0gdGhpc19mcmVlOworCSAgc3ByZXYgPSAmc2Jsay0+bmV4dDsKKwl9CiAgICAgfQogICB0 b3RhbF9zeW1ib2xzID0gbnVtX3VzZWQ7CiAgIHRvdGFsX2ZyZWVfc3ltYm9scyA9IG51bV9mcmVl OwpAQCAtNjk3NywxMyArNjk3NywxMyBAQCBzd2VlcF9taXNjICh2b2lkKQogICAgICAgaW50IHRo aXNfZnJlZSA9IDA7CiAKICAgICAgIGZvciAoaSA9IDA7IGkgPCBsaW07IGkrKykKLSAgICAgICAg ewotICAgICAgICAgIGlmICghbWJsay0+bWFya2Vyc1tpXS5tLnVfYW55LmdjbWFya2JpdCkKLSAg ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaWYgKG1ibGstPm1hcmtlcnNbaV0ubS51X2FueS50 eXBlID09IExpc3BfTWlzY19NYXJrZXIpCi0gICAgICAgICAgICAgICAgdW5jaGFpbl9tYXJrZXIg KCZtYmxrLT5tYXJrZXJzW2ldLm0udV9tYXJrZXIpOwotICAgICAgICAgICAgICBlbHNlIGlmICht YmxrLT5tYXJrZXJzW2ldLm0udV9hbnkudHlwZSA9PSBMaXNwX01pc2NfRmluYWxpemVyKQotICAg ICAgICAgICAgICAgIHVuY2hhaW5fZmluYWxpemVyICgmbWJsay0+bWFya2Vyc1tpXS5tLnVfZmlu YWxpemVyKTsKKwl7CisJICBpZiAoIW1ibGstPm1hcmtlcnNbaV0ubS51X2FueS5nY21hcmtiaXQp CisJICAgIHsKKwkgICAgICBpZiAobWJsay0+bWFya2Vyc1tpXS5tLnVfYW55LnR5cGUgPT0gTGlz cF9NaXNjX01hcmtlcikKKwkJdW5jaGFpbl9tYXJrZXIgKCZtYmxrLT5tYXJrZXJzW2ldLm0udV9t YXJrZXIpOworCSAgICAgIGVsc2UgaWYgKG1ibG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nZXQgKGxvY2FsX3ZhciwgUXBlcm1h bmVudF9sb2NhbCk7Ci0KLSAgICAgICAgICBpZiAoIU5JTFAgKHByb3ApKQotICAgICAgICAgICAg ewotICAgICAgICAgICAgICAvKiBJZiBwZXJtYW5lbnQtbG9jYWwsIGtlZXAgaXQuICAqLwotICAg ICAgICAgICAgICBsYXN0ID0gdG1wOwotICAgICAgICAgICAgICBpZiAoRVEgKHByb3AsIFFwZXJt YW5lbnRfbG9jYWxfaG9vaykpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAg LyogVGhpcyBpcyBhIHBhcnRpYWxseSBwZXJtYW5lbnQgaG9vayB2YXJpYWJsZS4KLSAgICAgICAg ICAgICAgICAgICAgIFByZXNlcnZlIG9ubHkgdGhlIGVsZW1lbnRzIHRoYXQgd2FudCB0byBiZSBw cmVzZXJ2ZWQuICAqLwotICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbGlzdCwgbmV3bGlz dDsKLSAgICAgICAgICAgICAgICAgIGxpc3QgPSBYQ0RSIChYQ0FSICh0bXApKTsKLSAgICAgICAg ICAgICAgICAgIGlmICghQ09OU1AgKGxpc3QpKQotICAgICAgICAgICAgICAgICAgICBuZXdsaXN0 ID0gbGlzdDsKLSAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgZm9y IChuZXdsaXN0ID0gUW5pbDsgQ09OU1AgKGxpc3QpOyBsaXN0ID0gWENEUiAobGlzdCkpCi0gICAg ICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3Qg ZWx0ID0gWENBUiAobGlzdCk7Ci0gICAgICAgICAgICAgICAgICAgICAgICAvKiBQcmVzZXJ2ZSBl bGVtZW50IEVMVCBpZiBpdCdzIHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBpZiBpdCBp cyBhIGZ1bmN0aW9uIHdpdGggYSBgcGVybWFuZW50LWxvY2FsLWhvb2snIHByb3BlcnR5LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgb3IgaWYgaXQncyBub3QgYSBzeW1ib2wuICAqLwotICAg ICAgICAgICAgICAgICAgICAgICAgaWYgKCEgU1lNQk9MUCAoZWx0KQotICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHx8IEVRIChlbHQsIFF0KQotICAgICAgICAgICAgICAgICAgICAgICAgICAg IHx8ICFOSUxQIChGZ2V0IChlbHQsIFFwZXJtYW5lbnRfbG9jYWxfaG9vaykpKQotICAgICAgICAg ICAgICAgICAgICAgICAgICBuZXdsaXN0ID0gRmNvbnMgKGVsdCwgbmV3bGlzdCk7Ci0gICAgICAg ICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgbmV3bGlzdCA9IEZucmV2ZXJzZSAo bmV3bGlzdCk7Ci0gICAgICAgICAgICAgICAgICBpZiAoWFNZTUJPTCAobG9jYWxfdmFyKS0+dHJh cHBlZF93cml0ZSA9PSBTWU1CT0xfVFJBUFBFRF9XUklURSkKLSAgICAgICAgICAgICAgICAgICAg bm90aWZ5X3ZhcmlhYmxlX3dhdGNoZXJzIChsb2NhbF92YXIsIG5ld2xpc3QsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgUW1ha3VuYm91bmQsIEZjdXJyZW50 X2J1ZmZlciAoKSk7Ci0gICAgICAgICAgICAgICAgICBYU0VUQ0RSIChYQ0FSICh0bXApLCBuZXds aXN0KTsKLSAgICAgICAgICAgICAgICAgIGNvbnRpbnVlOyAvKiBEb24ndCBkbyB2YXJpYWJsZSB3 cml0ZSB0cmFwcGluZyB0d2ljZS4gICovCi0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAg fQotICAgICAgICAgIC8qIERlbGV0ZSB0aGlzIGxvY2FsIHZhcmlhYmxlLiAgKi8KLSAgICAgICAg ICBlbHNlIGlmIChOSUxQIChsYXN0KSkKLSAgICAgICAgICAgIGJzZXRfbG9jYWxfdmFyX2FsaXN0 IChiLCBYQ0RSICh0bXApKTsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICBYU0VUQ0RSIChs YXN0LCBYQ0RSICh0bXApKTsKLQotICAgICAgICAgIGlmIChYU1lNQk9MIChsb2NhbF92YXIpLT50 cmFwcGVkX3dyaXRlID09IFNZTUJPTF9UUkFQUEVEX1dSSVRFKQotICAgICAgICAgICAgbm90aWZ5 X3ZhcmlhYmxlX3dhdGNoZXJzIChsb2NhbF92YXIsIFFuaWwsCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFFtYWt1bmJvdW5kLCBGY3VycmVudF9idWZmZXIgKCkpOwotICAg ICAgICB9CisJeworCSAgTGlzcF9PYmplY3QgbG9jYWxfdmFyID0gWENBUiAoWENBUiAodG1wKSk7 CisJICBMaXNwX09iamVjdCBwcm9wID0gRmdldCAobG9jYWxfdmFyLCBRcGVybWFuZW50X2xvY2Fs KTsKKworCSAgaWYgKCFOSUxQIChwcm9wKSkKKwkgICAgeworCSAgICAgIC8qIElmIHBlcm1hbmVu dC1sb2NhbCwga2VlcCBpdC4gICovCisJICAgICAgbGFzdCA9IHRtcDsKKwkgICAgICBpZiAoRVEg KHByb3AsIFFwZXJtYW5lbnRfbG9jYWxfaG9vaykpCisJCXsKKwkJICAvKiBUaGlzIGlzIGEgcGFy dGlhbGx5IHBlcm1hbmVudCBob29rIHZhcmlhYmxlLgorCQkgICAgIFByZXNlcnZlIG9ubHkgdGhl IGVsZW1lbnRzIHRoYXQgd2FudCB0byBiZSBwcmVzZXJ2ZWQuICAqLworCQkgIExpc3BfT2JqZWN0 IGxpc3QsIG5ld2xpc3Q7CisJCSAgbGlzdCA9IFhDRFIgKFhDQVIgKHRtcCkpOworCQkgIGlmICgh Q09OU1AgKGxpc3QpKQorCQkgICAgbmV3bGlzdCA9IGxpc3Q7CisJCSAgZWxzZQorCQkgICAgZm9y IChuZXdsaXN0ID0gUW5pbDsgQ09OU1AgKGxpc3QpOyBsaXN0ID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ICAg ICAgLyogTWF5YmUgdGhpcyBzaG91bGQgcmVhbGx5IHVzZSBzb21lIHN0YW5kYXJkIHN1YnJvdXRp bmUKLSAgICAgICAgIHdob3NlIGRlZmluaXRpb24gaXMgZmlsZW5hbWUgc3ludGF4IGRlcGVuZGVu dC4gICovCisJIHdob3NlIGRlZmluaXRpb24gaXMgZmlsZW5hbWUgc3ludGF4IGRlcGVuZGVudC4g ICovCiAgICAgICBsZW4gPSBzdHJsZW4gKHB3ZCk7CiAgICAgICBpZiAoIShJU19ESVJFQ1RPUllf U0VQIChwd2RbbGVuIC0gMV0pKSkKLSAgICAgICAgewotICAgICAgICAgIC8qIEdyb3cgYnVmZmVy IHRvIGFkZCBkaXJlY3Rvcnkgc2VwYXJhdG9yIGFuZCAnXDAnLiAgKi8KLSAgICAgICAgICBwd2Qg PSByZWFsbG9jIChwd2QsIGxlbiArIDIpOwotICAgICAgICAgIGlmICghcHdkKQotICAgICAgICAg ICAgZmF0YWwgKCJnZXRfY3VycmVudF9kaXJfbmFtZTogJXNcbiIsIHN0cmVycm9yIChlcnJubykp OwotICAgICAgICAgIHB3ZFtsZW5dID0gRElSRUNUT1JZX1NFUDsKLSAgICAgICAgICBwd2RbbGVu ICsgMV0gPSAnXDAnOwotICAgICAgICAgIGxlbisrOwotICAgICAgICB9CisJeworCSAgLyogR3Jv dyBidWZmZXIgdG8gYWRkIGRpcmVjdG9yeSBzZXBhcmF0b3IgYW5kICdcMCcuICAqLworCSAgcHdk ID0gcmVhbGxvYyAocHdkLCBsZW4gKyAyKTsKKwkgIGlmICghcHdkKQorCSAgICBmYXRhbCAoImdl dF9jdXJyZW50X2Rpcl9uYW1lOiAlc1xuIiwgc3RyZXJyb3IgKGVycm5vKSk7CisJICBwd2RbbGVu XSA9IERJUkVDVE9SWV9TRVA7CisJICBwd2RbbGVuICsgMV0gPSAnXDAnOworCSAgbGVuKys7CisJ fQogCiAgICAgICAvKiBBdCB0aGlzIG1vbWVudCwgd2Ugc3RpbGwgZ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U28gYXZvaWQgZG9p bmcgdGhhdC4gICovCi0gICAgICAgICAgJiYgc3RyY21wICgiLyIsIFNTREFUQSAoQlZBUiAoY3Vy cmVudF9idWZmZXIsIGRpcmVjdG9yeSkpKSkKLSAgICAgICAgewotICAgICAgICAgIEFVVE9fU1RS SU5HIChzbGFzaF9jb2xvbiwgIi86Iik7Ci0gICAgICAgICAgYnNldF9kaXJlY3RvcnkgKGN1cnJl bnRfYnVmZmVyLAotICAgICAgICAgICAgICAgICAgICAgICAgICBjb25jYXQyIChzbGFzaF9jb2xv biwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgQlZBUiAoY3VycmVudF9idWZm ZXIsIGRpcmVjdG9yeSkpKTsKLSAgICAgICAgfQorCSAgLyogSWYgdGhlIGRlZmF1bHQgZGlyIGlz IGp1c3QgLywgVEVNUCBpcyBub24tbmlsCisJICAgICBiZWNhdXNlIG9mIHRoZSBhbmdlLWZ0cCBj b21wbGV0aW9uIGhhbmRsZXIuCisJICAgICBIb3dldmVyLCBpdCBpcyBub3QgbmVjZXNzYXJ5IHRv IHR1cm4gLyBpbnRvIC86Ly4KKwkgICAgIFNvIGF2b2lkIGRvaW5nIHRoYXQuICAqLworCSAgJiYg c3RyY21wICgiLyIsIFNTREFUQSAoQlZBUiAoY3VycmVudF9idWZmZXIsIGRpcmVjdG9yeSkpKSkK Kwl7CisJICBBVVRPX1NUUklORyAoc2xhc2hfY29sb24sICIvOiIpOworCSAgYnNldF9kaXJlY3Rv cnkgKGN1cnJlbnRfYnVmZmVyLAorCQkJICBjb25jYXQyIChzbGFzaF9jb2xvbiwKKwkJCQkgICBC VkFSIChjdXJyZW50X2J1ZmZlciwgZGlyZWN0b3J5KSkpOworCX0KICAgICB9CiAKICAgdGVtcCA9 IGdldF9taW5pYnVmZmVyICgwKTsKQEAgLTU0ODksMjAgKzU0ODksMjAgQEAgQSBzdHJpbmcgaXMg cHJpbnRlZCB2ZXJiYXRpbSBpbiB0aGUgbW9kZSB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HB0cmRpZmZfdCB2YXJsZW4sIGNoYXIgKip2 YWx1ZSwKICAgICBjaGFyKiB0bXB2YWwgPSBnZXRlbnYgKHZhcik7CiAgICAgaWYgKHRtcHZhbCkK ICAgICAgIHsKLSAgICAgICAgKnZhbHVlID0gdG1wdmFsOwotICAgICAgICAqdmFsdWVsZW4gPSBz dHJsZW4gKHRtcHZhbCk7Ci0gICAgICAgIHJldHVybiAxOworCSp2YWx1ZSA9IHRtcHZhbDsKKwkq dmFsdWVsZW4gPSBzdHJsZW4gKHRtcHZhbCk7CisJcmV0dXJuIDE7CiAgICAgICB9CiAgIH0KICNl bmRpZgpAQCAtMTQ3OCwyNSArMTQ3OCwyNSBAQCBpbml0X2NhbGxwcm9jXzEgKHZvaWQpCiAKICAg VmRhdGFfZGlyZWN0b3J5ID0gZGVjb2RlX2Vudl9wYXRoICgiRU1BQ1NEQVRBIiwKICNpZmRlZiBI QVZFX05TCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldGNf ZGlyID8gZXRjX2RpciA6CisJCQkJCSAgICAgZXRjX2RpciA/IGV0Y19kaXIgOgogI2VuZGlmCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBQQVRIX0RBVEEsIDAp OworCQkJCQkgICAgIFBBVEhfREFUQSwgMCk7CiAgIFZkYXRhX2RpcmVjdG9yeSA9IEZmaWxlX25h bWVfYXNfZGlyZWN0b3J5IChGY2FyIChWZGF0YV9kaXJlY3RvcnkpKTsKIAogICBWZG9jX2RpcmVj dG9yeSA9IGRlY29kZV9lbnZfcGF0aCAoIkVNQUNTRE9DIiwKICNpZmRlZiBIQVZFX05TCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBldGNfZGlyID8gZXRjX2Rp ciA6CisJCQkJCSAgICAgZXRjX2RpciA/IGV0Y19kaXIgOgogI2VuZGlmCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgIC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IEJld2FyZSBlbmQgb2Ygc2NyZWVu ISAqLwogCX0KIAllbHNlCi0gICAgICAgICAgY3VyWCAodHR5KS0tOworCSAgY3VyWCAodHR5KS0t OwogICAgIH0KIH0KICNlbmRpZgpAQCAtMTc2LDE3ICsxNzYsMTcgQEAgY21jb3N0aW5pdCAoc3Ry dWN0IHR0eV9kaXNwbGF5X2luZm8gKnR0eSkKIAogc3RhdGljIGludAogY2FsY2Nvc3QgKHN0cnVj dCB0dHlfZGlzcGxheV9pbmZvICp0dHksCi0gICAgICAgICAgaW50IHNyY3ksIGludCBzcmN4LCBp bnQgZHN0eSwgaW50IGRzdHgsIGludCBkb2l0KQorCSAgaW50IHNyY3ksIGludCBzcmN4LCBpbnQg ZHN0eSwgaW50IGRzdHgsIGludCBkb2l0KQogewogICAgIHJlZ2lzdGVyIGludCAgICBkZWx0YXks Ci0gICAgICAgICAgICAgICAgICAgIGRlbHRheCwKLSAgICAgICAgICAgICAgICAgICAgYywKLSAg ICAgICAgICAgICAgICAgICAgdG90YWxjb3N0OworCQkgICAgZGVsdGF4LAorCQkgICAgYywKKwkJ ICAgIHRvdGFsY29zdDsKICAgICBpbnQgICAgIG50YWJzLAotICAgICAgICAgICAgbjJ0YWJzLAot ICAgICAgICAgICAgdGFieCwKLSAgICAgICAgICAgIHRhYjJ4LAotICAgICAgICAgICAgdGFiY29z dDsKKwkgICAgbjJ0YWJzLAorCSAgICB0YWJ4LAorCSAgICB0YWIyeCwKKwkgICAgdGFiY29zdDsK ICAgICByZWdpc3RlciBjb25zdCBjaGFyICpwOwogCiAgICAgLyogSWYgaGF2ZSBqdXN0IHdyYXBw ZWQgb24gYSB0ZXJtaW5hbCB3aXRoIHhuLApAQCAtMjExLDcgKzIxMSw3IEBAIGNhbGNjb3N0IChz dHJ1Y3QgdHR5X2Rpc3BsYXlfaW5mbyAqdHR5LAogICAgIHRvdGFsY29zdCA9IGMgKiBkZWx0YXk7 CiAgICAgaWYgKGRvaXQpCiAgICAgICBkbwotIC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GxsY29zdCwKLSAgICAgICAgICAgIHJlbGNvc3QsCi0gICAgICAgICAgICBkaXJlY3Rj b3N0OworCSAgICBjcmNvc3QsCisJICAgIGxsY29zdCwKKwkgICAgcmVsY29zdCwKKwkgICAgZGly ZWN0Y29zdDsKICAgICBpbnQgdXNlIFVOSU5JVDsKICAgICBjaGFyICpwOwogICAgIGNvbnN0IGNo YXIgKmRjbTsKQEAgLTMzOSwyMSArMzM5LDIxIEBAIGNtZ290byAoc3RydWN0IHR0eV9kaXNwbGF5 X2luZm8gKnR0eSwgaW50IHJvdywgaW50IGNvbCkKICAgICAgIHJlbGNvc3QgPSBjYWxjY29zdCAo dHR5LCBjdXJZICh0dHkpLCBjdXJYICh0dHkpLCByb3csIGNvbCwgMCk7CiAgICAgICB1c2UgPSBV U0VSRUw7CiAgICAgICBpZiAoKGhvbWVjb3N0ID0gdHR5LT5XY20tPmNjX2hvbWUpIDwgQklHKQot ICAgICAgICAgIGhvbWVjb3N0ICs9IGNhbGNjb3N0ICh0dHksIDAsIDAsIHJvdywgY29sLCAwKTsK KwkgIGhvbWVjb3N0ICs9IGNhbGNjb3N0ICh0dHksIDAsIDAsIHJvdywgY29sLCAwKTsKICAgICAg IGlmIChob21lY29zdCA8IHJlbGNvc3QpCi0gICAgICAgICAgcmVsY29zdCA9IGhvbWVjb3N0LCB1 c2UgPSBVU0VIT01FOworCSAgcmVsY29zdCA9IGhvbWVjb3N0LCB1c2UgPSBVU0VIT01FOwogICAg ICAgaWYgKChsbGNvc3QgPSB0dHktPldjbS0+Y2NfbGwpIDwgQklHKQotICAgICAgICAgIGxsY29z dCArPSBjYWxjY29zdCAodHR5LCB0dHktPldjbS0+Y21fcm93cyAtIDEsIDAsIHJvdywgY29sLCAw KTsKKwkgIGxsY29zdCArPSBjYWxjY29zdCAodHR5LCB0dHktPldjbS0+Y21fcm93cyAtIDEsIDAs IHJvdywgY29sLCAwKTsKICAgICAgIGlmIChsbGNvc3QgPCByZWxjb3N0KQotICAgICAgICAgIHJl bGNvc3QgPSBsbGNvc3QsIHVzZSA9IFVTRUxMOworCSAgcmVsY29zdCA9IGxsY29zdCwgdXNlID0g VVNFTEw7CiAgICAgICBpZiAoKGNyY29zdCA9IHR0eS0+V2NtLT5jY19jcikgPCBCSUcpIHsKIAkg IGlmICh0dHktPldjbS0+Y21fYXV0b2xmKQotICAgICAgICAgICAgaWYgKGN1clkgKHR0eSkgKyAx ID49IHR0eS0+V2NtLT5jbV9yb3dzKQotICAgICAgICAgICAgICAgIGNyY29zdCA9IEJJRzsKKwkg ICAgaWYgKGN1clkgKHR0eSkgKyAxID49IHR0eS0+V2NtLT5jbV9yb3dzKQorCQljcmNvc3QgPSBC SUc7CiAJICAgICAgZWxzZQotICAgICAgICAgICAgICAgIGNyY29zdCArPSBjYWxjY29zdCAodHR5 LCBjdXJZICh0dHkpICsgMSwgMCwgcm93LCBjb2wsIDApOworCQljcmNvc3QgKz0gY2FsY2Nvc3Qg KHR0eSwgY3VyWSAodHR5KSArIDEsIDAsIHJvdywgY29sLCAwKTsKIAkgIGVsc2UKLSAgICAgICAg ICAgIGNyY29zdCArPSBjYWxjY29zdCAodHR5LCBjdXJZICh0dHkpLCAwLCByb3csIGNvbCwgMCk7 CisJICAgIGNyY29zdCArPSBjYWxjY29zdCAodHR5LCBjdXJZICh0dHkpLCAwLCByb3csIGNvbCwg MCk7CiAgICAgICB9CiAgICAgICBpZiAoY3Jjb3N0IDwgcmVsY29zdCkKIAkgIHJlbGNvc3QgPSBj cmNvc3QsIHVzZSA9IFVTRUNSOwpAQCAtMzc4LDggKzM3OCw4IEBAIGNtZ290byAoc3RydWN0IHR0 eV9kaXNwbGF5X2luZm8gKnR0eSwgaW50IHJvdywgaW50IGNvbCkKICAgICAgIC8qIGNvbXB1dGUg UkVBTCBkaXJlY3QgY29zdCAqLwogICAgICAgY29zdCA9IDA7CiAgICAgICBwID0gKGRjbSA9PSB0 dHktPldjbS0+Y21faGFicwotICAgICAgICAgICA/IHRnb3RvIChkY20sIHJvdywgY29sKQotICAg ICAgICAgICA6IHRnb3RvIChkY20sIGNvbCwgcm93KSk7CisJICAgPyB0Z290byAoZGNtLCByb3cs IGNvbCkKKwkgICA6IHRnb3RvIChkY20sIGNvbCwgcm93KSk7CiAgICAgICBlbWFjc190cHV0cyAo dHR5LCBwLCAxLCBldmFsY29zdCk7CiAgICAgICBpZiAoY29zdCA8PSByZWxjb3N0KQogCXsJLyog cmVhbGx5IGlzIGNoZWFwZXIgKi8KZGlmZiAtLWdpdCBhL3NyYy9jbWRzLmMgYi9zcmMvY21kcy5j CmluZGV4IDQwMDNkOGIuLjhmZWM3YmEgMTAwNjQ0Ci0tLSBhL3NyYy9jbWRzLmMKKysrIGIvc3Jj L2NtZHMuYwpAQCAtMzI2LDcgKzMyNiw3IEBAIGludGVybmFsX3NlbGZfaW5zZXJ0IChpbnQgYywg RU1BQ1NfSU5UIG4pCiAgICAgICBsZW4gPSBDSEFSX1NUUklORyAoYywgc3RyKTsKICAgICAgIGlm IChsZW4gPT0gMSkKIAkvKiBJZiBDIGhhcyBtb2RpZmllciBiaXRzLCB0aGlzIG1ha2VzIEMgYW4g YXBwcm9wcmlhdGUKLSAgICAgICAgICAgb25lLWJ5dGUgY2hhci4gICovCisJICAgb25lLWJ5dGUg Y2hhci4gICovCiAJYyA9ICpzdHI7CiAgICAgfQogICBlbHNlCkBAIC00OTYsNyArNDk2LDcgQEAg c3ltc19vZl9jbWRzICh2b2lkKQogewogICBERUZTWU0gKFF1bmRvX2F1dG9fYW1hbGdhbWF0ZSwg InVuZG8tYXV0by1hbWFsZ2FtYXRlIik7CiAgIERFRlNZTSAoUXVuZG9fYXV0b19fdGhpc19jb21t YW5kX2FtYWxnYW1hdGluZywKLSAgICAgICAgICAidW5kby1hdXRvLS10aGlzLWNvbW1hbmQtYW1h bGdhbWF0aW5nIik7CisJICAidW5kby1hdXRvLS10aGlzLWNvbW1hbmQtYW1hbGdhbWF0aW5nIik7 CiAKICAgREVGU1lNIChRa2lsb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pbmcgKExpc3BfT2JqZWN0 LCBMaXNwX09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBM aXNwX09iamVjdCwgYm9vbCwgYm9vbCwgYm9vbCk7CisJCQkJCUxpc3BfT2JqZWN0LCBib29sLCBi b29sLCBib29sKTsKIGV4dGVybiBMaXNwX09iamVjdCBjb2RlX2NvbnZlcnRfc3RyaW5nX25vcmVj b3JkIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCk7CisJCQkJCQkgYm9vbCk7CiBleHRlcm4gTGlz cF9PYmplY3QgZW5jb2RlX2ZpbGVfbmFtZSAoTGlzcF9PYmplY3QpOwogZXh0ZXJuIExpc3BfT2Jq ZWN0IGRlY29kZV9maWxlX25hbWUgKExpc3BfT2JqZWN0KTsKIGV4dGVybiBMaXNwX09iamVjdCBy YXdfdGV4dF9jb2Rpbmdfc3lzdGVtIChMaXNwX09iamVjdCk7CkBAIC03MTQsMTEgKzcxNCwxMSBA QCBleHRlcm4gTGlzcF9PYmplY3QgY29tcGxlbWVudF9wcm9jZXNzX2VuY29kaW5nX3N5c3RlbSAo TGlzcF9PYmplY3QpOwogZXh0ZXJuIHZvaWQgZGVjb2RlX2NvZGluZ19nYXAgKHN0cnVjdCBjb2Rp bmdfc3lzdGVtICosCiAJCQkgICAgICAgcHRyZGlmZl90LCBwdHJkaWZmX3QpOwogZXh0ZXJuIHZv aWQgZGVjb2RlX2NvZGluZ19vYmplY3QgKHN0cnVjdCBjb2Rpbmdfc3lzdGVtICosCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QsIHB0cmRpZmZfdCwgcHRyZGlm Zl90LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cmRpZmZfdCwgcHRyZGlm Zl90LCBMaXNwX09iamVjdCk7CisJCQkJICBMaX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09iamVjdCwgTGlzcF9PYmplY3QsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0KTsKKwkJCSAgTGlzcF9PYmplY3QpOwog CiAvKiBSZXR1cm4gdGhlIG1ldGhvZCBvZiBhIGNvbXBvc2l0aW9uIHdpdGggcHJvcGVydHkgUFJP UC4gICovCiAKQEAgLTMxNCwxNiArMzE0LDE2IEBAIGV4dGVybiBMaXNwX09iamVjdCBjb21wb3Np dGlvbl9nc3RyaW5nX3B1dF9jYWNoZSAoTGlzcF9PYmplY3QsIHB0cmRpZmZfdCk7CiBleHRlcm4g TGlzcF9PYmplY3QgY29tcG9zaXRpb25fZ3N0cmluZ19mcm9tX2lkIChwdHJkaWZmX3QpOwogZXh0 ZXJuIGJvb2wgY29tcG9zaXRpb25fZ3N0cmluZ19wIChMaXNwX09iamVjdCk7CiBleHRlcm4gaW50 IGNvbXBvc2l0aW9uX2dzdHJpbmdfd2lkdGggKExpc3BfT2JqZWN0LCBwdHJkaWZmX3QsIHB0cmRp ZmZfdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnRf bWV0cmljcyAqKTsKKwkJCQkgICAgICBzdHJ1Y3QgZm9udF9tZXRyaWNzICopOwogCiBleHRlcm4g dm9pZCBjb21wb3NpdGlvbl9jb21wdXRlX3N0b3BfcG9zIChzdHJ1Y3QgY29tcG9zaXRpb25faXQg KiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cmRpZmZfdCwg cHRyZGlmZl90LCBwdHJkaWZmX3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBMaXNwX09iamVjdCk7CisJCQkJCSAgcHRyZGlmZl90LCBwdHJkaWZmX3QsIHB0cmRp ZmZfdCwKKwkJCQkJICBMaXNwX09iamVjdCk7CiBleHRlcm4gYm9vbCBjb21wb3NpdGlvbl9yZXNl YXRfaXQgKHN0cnVjd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IChuZXd2YWwsIEZzeW1ib2xfdmFsdWUgKHN5bWJvbCkpKQotICAgICAgICB4 c2lnbmFsMSAoUXNldHRpbmdfY29uc3RhbnQsIHN5bWJvbCk7CisJICB8fCAhRVEgKG5ld3ZhbCwg RnN5bWJvbF92YWx1ZSAoc3ltYm9sKSkpCisJeHNpZ25hbDEgKFFzZXR0aW5nX2NvbnN0YW50LCBz eW1ib2wpOwogICAgICAgZWxzZQotICAgICAgICAvKiBBbGxvdyBzZXR0aW5nIGtleXdvcmRzIHRv IHRoZWlyIG93biB2YWx1ZS4gICovCi0gICAgICAgIHJldHVybjsKKwkvKiBBbGxvdyBzZXR0aW5n IGtleXdvcmRzIHRvIHRoZWlyIG93biB2YWx1ZS4gICovCisJcmV0dXJuOwogCiAgICAgY2FzZSBT WU1CT0xfVFJBUFBFRF9XUklURToKICAgICAgIC8qIFNldHRpbmcgZHVlIHRvIHRocmVhZC1zd2l0 Y2hpbmcgZG9lc24ndCBjb3VudC4gICovCiAgICAgICBpZiAoYmluZGZsYWcgIT0gU0VUX0lOVEVS TkFMX1RIUkVBRF9TV0lUQ0gpCi0gICAgICAgIG5vdGlmeV92YXJpYWJsZV93YXRjaGVycyAoc3lt Ym9sLCB2b2lkZT8gUW5pbCA6IG5ld3ZhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoYmluZGZsYWcgPT0gU0VUX0lOVEVSTkFMX0JJTkQ/IFFsZXQgOgotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBiaW5kZmxhZyA9PSBTRVRfSU5URVJOQUxfVU5CSU5EPyBR dW5sZXQgOgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkZT8gUW1ha3Vu Ym91bmQgOiBRc2V0KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aGVyZSk7 CisJbm90aWZ5X3ZhcmlhYmxlX3dhdGNoZXJzIChzeW1ib2wsIHZvaWRlPyBRbmlsIDog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3dvcmRzKQogICAgIHsKICAgICAgIC8qIElmIHdlIHN0b3BwZWQgYmVjYXVzZSBv ZiBhIG1pc21hdGNoLCBzZWUgaG93IG1hbnkgYml0cyBtYXRjaAotICAgICAgICAgaW4gdGhlIGN1 cnJlbnQgbXdvcmQuICAqLworCSBpbiB0aGUgY3VycmVudCBtd29yZC4gICovCiAgICAgICBtd29y ZCA9IGJpdHNfd29yZF90b19ob3N0X2VuZGlhbiAoYWRhdGFbcG9zXSk7CiAgICAgICBtd29yZCBe PSB0d2lkZGxlOwogICAgICAgY291bnQgKz0gY291bnRfdHJhaWxpbmdfemVyb19iaXRzIChtd29y ZCk7CkBAIC0zNTIxLDggKzM1MjEsOCBAQCBBIGlzIGEgYm9vbCB2ZWN0b3IsIEIgaXMgdCBvciBu aWwsIGFuZCBJIGlzIGFuIGluZGV4IGludG8gQS4gICovKQogICBlbHNlIGlmIChucl9iaXRzICUg QklUU19QRVJfQklUU19XT1JEICE9IDApCiAgICAgewogICAgICAgLyogSWYgd2UgaGl0IHRoZSBl bmQsIHdlIG1pZ2h0IGhhdmUgb3ZlcnNob3Qgb3VyIGNvdW50LiAgUmVkdWNlCi0gICAgICAgICB0 aGUgdG90YWwgYnkgdGhlIG51bWJlciBvZiBzcGFyZSBiaXRzIGF0IHRoZSBlbmQgb2YgdGhlCi0g ICAgICAgICB2ZWN0b3IuICAqLworCSB0aGUgdG90YWwgYnkgdGhlIG51bWJlciBvZiBzcGFyZSBi aXRzIGF0IHRoZSBlbmQgb2YgdGhlCisJIHZlY3Rvci4gICovCiAgICAgICBjb3VudCAtPSBCSVRT X1BFUl9CSVRTX1dPUkQgLSBucl9iaXRzICUgQklUU19QRVJfQklUU19XT1JEOwogICAgIH0KIApA QCAtMzYzMyw3ICszNjMzLDcgQEAgc3ltc19vZl9kYXRhICh2b2lkKQogICBQVVRfRVJST1IgKFFz ZXR0aW5nX2NvbnN0YW50LCBlcnJvcl90YWlsLAogCSAgICAgIkF0dGVtcHQgdG8gc2V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vb2wsIGlu dCk7CisJCQkgICAgIGJvb2wsIGludCk7CiBpbnQgZmFjZV9mb3Jfb3ZlcmxheV9zdHJpbmcgKHN0 cnVjdCB3aW5kb3cgKiwgcHRyZGlmZl90LCBwdHJkaWZmX3QgKiwgcHRyZGlmZl90LAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBib29sLCBMaXNwX09iamVjdCk7CisJCQkgICAgIGJvb2ws IExpc3BfT2JqZWN0KTsKIGludCBmYWNlX2F0X3N0cmluZ19wb3NpdGlvbiAoc3RydWN0IHdpbmRv dyAqLCBMaXNwX09iamVjdCwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHB0cmRpZmZfdCAqLCBlbnVtIGZhY2VfaWQsIGJvb2wpOworCQkJICAgICBw dHJkaWZmX3QgKiwgZW51bSBmYWNlX2lkLCBib29sKTsKIGludCBtZXJnZV9mYWNlcyAoc3RydWN0 IGZyYW1lICosIExpc3BfT2JqZWN0LCBpbnQsIGludCk7CiBpbnQgY29tcHV0ZV9jaGFyX2ZhY2Ug KHN0cnVjdCBmcmFtZSAqLCBpbnQsIExpc3BfT2JqZWN0KTsKIHZvaWQgZnJlZV9hbGxfcmVhbGl6 ZWRfZmFjZXMgKExpc3BfT2JqZWN0KTsKQEAgLTM0OTgsMTggKzM0OTgsMTggQEAgaW50IHBvcHVw X2FjdGl2YXRlZCAodm9pZCk7CiAvKiBEZWZpbmVkIGluIGRpc3BuZXcuYy4gICovCiAKIGV4dGVy biBMaXNwX09iamVjdCBidWZmZXJfcG9zbl9mcm9tX2Nvb3JkcyAoc3RydWN0IHdpbmRvdyAqLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKiwgaW50ICos Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHN0cnVjdCBkaXNw bGF5X3BvcyAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBM aXNwX09iamVjdCAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgKiwgaW50ICosIGludCAqLCBpbnQgKik7CisJCQkJCSAgICBpbnQgKiwgaW50ICosCisJ CQkJCSAgICBzdHJ1Y3QgZGlzcGxheV9wb3MgKiwKKwkJCQkJICAgIExpc3BfT2JqZWN0ICosCisJ CQkJCSAgICBpbnQgKiwgaW50ICosIGludCAqLCBpbnQgKik7CiBleHRlcm4gTGlzcF9PYmplY3Qg bW9kZV9saW5lX3N0cmluZyAoc3RydWN0IHdpbmRvdyAqLCBlbnVtIHdpbmRvd19wYXJ0LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqLCBpbnQgKiwgcHRyZGlmZl90 ICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgKiwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgKiwgaW50ICosIGludCAq LCBpbnQgKik7CisJCQkJICAgICBpbnQgKiwgaW50ICosIHB0cmRpZmZfdCAqLAorCQkJCSAgICAg TGlzcF9PYmplY3QgKiwKKwkJCQkgICAgIGludCAqLCBpbnQgKiwgaW50ICosIGludCAqKTsKIGV4 dGVybiBMaXNwX09iamVjdCBtYXJnaW5hbF9hcmVhX3N0cmluZyAoc3RydWN0IHdpbmRvdyAqLCBl bnVtIHdpbmRvd19wYXJ0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBpbnQgKiwgaW50ICosIHB0cmRpZmZfdCAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBMaXNwX09iamVjdCAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgKiwgaW50ICosIGludCAqLCBpbnQgKik7CisJCQkJCSBpbnQgKiwg aW50ICosIHB0cmRpZmZfd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x5cGhfbWF0cml4X3Jvd3MgKHN0 cnVjdCBnbHlwaF9tYXRyaXggKiwgaW50LCBpbnQpOwogdm9pZCBjbGVhcl9nbHlwaF9yb3cgKHN0 cnVjdCBnbHlwaF9yb3cgKik7CkBAIC0zNTc2LDExICszNTc2LDExIEBAIGV4dGVybiB2b2lkIHR0 eV9hcHBlbmRfZ2x5cGggKHN0cnVjdCBpdCAqKTsKIAogZXh0ZXJuIGludCBzY3JvbGxpbmdfbWF4 X2xpbmVzX3NhdmVkIChpbnQsIGludCwgdW5zaWduZWQgKiwgdW5zaWduZWQgKiwgaW50ICopOwog ZXh0ZXJuIHZvaWQgZG9fbGluZV9pbnNlcnRpb25fZGVsZXRpb25fY29zdHMgKHN0cnVjdCBmcmFt ZSAqLCBjb25zdCBjaGFyICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY29uc3QgY2hhciAqLCBjb25zdCBjaGFyICosCisJCQkJCSAgICAgIGNvbnN0IGNo YXIgKiwgY29uc3QgY2hhciAqLAogCQkJCQkgICAgICBjb25zdCBjaGFyICosIGNvbnN0IGNoYXIg KiwKIAkJCQkJICAgICAgY29uc3QgY2hhciAqLCBpbnQpOwogdm9pZCBzY3JvbGxpbmdfMSAoc3Ry dWN0IGZyYW1lICosIGludCwgaW50LCBpbnQsIGludCAqLCBpbnQgKiwgdW5zaWduZWQgKiwKLSAg ICAgICAgICAgICAgICAgIHVuc2lnbmVkICosIGludCk7CisJCSAgdW5zaWduZWQgKiwgaW50KTsK IAogLyogRGVmaW5lZCBpbiBmcmFtZS5jICovCiAKQEAgLTM1OTksMTYgKzM1OTksMTYgQEAgZW51 bSByZXNvdXJjZV90eXBlcwogCiBleHRlcm4gRGlzcGxheV9JbmZvICpjaGVja194X2Rpc3BsYXlf aW5mbyAoTGlzcF9PYmplY3QpOwogZXh0ZXJuIExpc3BfT2JqZWN0IHhfZ2V0X2FyZyAoRGlzcGxh eV9JbmZvICosIExpc3BfT2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QsIGNvbnN0IGNoYXIgKiwgY29uc3QgY2hhciAqY2xhc3MsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBlbnVtIHJlc291cmNlX3R5cGVzKTsKKwkJCSAgICAgIExpc3BfT2Jq ZWN0LCBjb25zdCBjaGFyICosIGNvbnN0IGNoYXIgKmNsYXNzLAorCQkJICAgICAgZW51bSByZXNv dXJjZV90eXBlcyk7CiBleHRlcm4gTGlzcF9PYmplY3QgeF9mcmFtZV9nZXRfYW5kX3JlY29yZF9h cmcgKHN0cnVjdCBmcmFtZSAqLCBMaXNwX09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QsCisJCQkJCSAgICAgICBMaXNwX09i amVjdCwKIAkJCQkJICAgICAgIGNvbnN0IGNoYXIgKiwgY29uc3QgY2hhciAqLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIHJlc291cmNlX3R5cGVz KTsKKwkJCQkJICAgICAgIGVudW0gcmVzb3VyY2VfdHlwZXMpOwogZXh0ZXJuIExpc3BfT2JqZWN0 IHhfZGVmYXVsdF9wYXJhbWV0ZXIgKHN0cnVjdCBmcmFtZSAqLCBMaXNwX09iamVjdCwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCwgTGlzcF9PYmpl Y3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAq LCBjb25zdCBjaGFyICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ZW51bSByZXNvdXJjZV90eXBlcyk7CisJCQkJCUxpc3BfT2JqZWN0LCBMaXNwX09iamVjdCwKKwkJ CQkJY29uc3QgY2hhciAqLCBjb25zdCBjaGFyICosCisJCQ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AgdGhlIHNhbWUgZmlsZSBuYW1lIGlzIGZvdW5kIGluIHRo ZSBgZG9jLWRpcmVjdG9yeScuICAqLykKIAl7CiAJICBlbmQgPSBzdHJjaHIgKHAsICdcbicpOwog Ci0gICAgICAgICAgLyogU2VlIGlmIHRoaXMgaXMgYSBmaWxlIG5hbWUsIGFuZCBpZiBpdCBpcyBh IGZpbGUgaW4gYnVpbGQtZmlsZXMuICAqLwotICAgICAgICAgIGlmIChwWzFdID09ICdTJykKLSAg ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgc2tpcF9maWxlID0gMDsKLSAgICAgICAgICAgICAg aWYgKGVuZCAtIHAgPiA0ICYmIGVuZFstMl0gPT0gJy4nCi0gICAgICAgICAgICAgICAgICAmJiAo ZW5kWy0xXSA9PSAnbycgfHwgZW5kWy0xXSA9PSAnYycpKQotICAgICAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgICAgIHB0cmRpZmZfdCBsZW4gPSBlbmQgLSBwIC0gMjsKLSAgICAgICAgICAg ICAgICAgIGNoYXIgKmZyb21maWxlID0gU0FGRV9BTExPQ0EgKGxlbiArIDEpOwotICAgICAgICAg ICAgICAgICAgbWVtY3B5IChmcm9tZmlsZSwgJnBbMl0sIGxlbik7Ci0gICAgICAgICAgICAgICAg ICBmcm9tZmlsZVtsZW5dID0gMDsKLSAgICAgICAgICAgICAgICAgIGlmIChmcm9tZmlsZVtsZW4t MV0gPT0gJ2MnKQotICAgICAgICAgICAgICAgICAgICBmcm9tZmlsZVtsZW4tMV0gPSAnbyc7Ci0K LSAgICAgICAgICAgICAgICAgIHNraXBfZmlsZSA9IE5JTFAgKEZtZW1iZXIgKGJ1aWxkX3N0cmlu ZyAoZnJvbWZpbGUpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgVmJ1aWxkX2ZpbGVzKSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorCSAg LyogU2VlIGlmIHRoaXMgaXMg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LiAgKi8KLSAgICAgICAgICAgICAg ICAgIGlmICghTklMUCAoRmJvdW5kcCAoc3ltKSkKLSAgICAgICAgICAgICAgICAgICAgICB8fCAh TklMUCAoRm1lbXEgKHN5bSwgZGVsYXllZF9pbml0KSkpCi0gICAgICAgICAgICAgICAgICAgIEZw dXQgKHN5bSwgUXZhcmlhYmxlX2RvY3VtZW50YXRpb24sCi0gICAgICAgICAgICAgICAgICAgICAg ICAgIG1ha2VfbnVtYmVyICgocG9zICsgZW5kICsgMSAtIGJ1ZikKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICogKGVuZFsxXSA9PSAnKicgPyAtMSA6IDEpKSk7CisJCSAg aWYgKCFOSUxQIChGYm91bmRwIChzeW0pKQorCQkgICAgICB8fCAhTklMUCAoRm1lbXEgKHN5bSwg ZGVsYXllZF9pbml0KSkpCisJCSAgICBGcHV0IChzeW0sIFF2YXJpYWJsZV9kb2N1bWVudGF0aW9u LAorCQkJICBtYWtlX251bWJlciAoKHBvcyArIGVuZCArIDEgLSBidWYpCisJCQkJICAgICAgICog KGVuZFsxXSA9PSAnKicgPyAtMSA6IDEpKSk7CiAJCX0KIAogCSAgICAgIC8qIEF0dGFjaCBhIGRv Y3N0cmluZyB0byBhIGZ1bmN0aW9uPyAgKi8KIAkgICAgICBlbHNlIGlmIChwWzFdID09ICdGJykK LSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBpZiAoIU5JTFAgKEZmYm91bmRw IChzeW0pKSkKLSAgICAgICAgICAgICAgICAgICAgc3RvcmVfZnVuY3Rpb25fZG9jc3RyaW5nIChz eW0sIHBvcyArIGVuZCArIDEgLSBidWYpOwotICAgICAgICAgICAgICAgIH0KKwkJeworCQkgIGlm ICghTklMUCAoRmZib3VuZHAgKHN5bSkpKQorCQkgICAgc3RvcmVfZnVuY3Rpb25fZG9jc3RyaW5n IChzeW0sIHBvcyArIGVuZCArIDEgLSBidWYpOworCQl9CiAJICAgICAgZWx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sKKwkgIG1lbWNweSAodGVtcCwgc3RhcnQy X2FkZHIsIGxlbjJfYnl0ZSk7CisJICBtZW1jcHkgKHN0YXJ0MV9hZGRyICsgbGVuX21pZCArIGxl bjJfYnl0ZSwgc3RhcnQxX2FkZHIsIGxlbjFfYnl0ZSk7CisJICBtZW1tb3ZlIChzdGFydDFfYWRk ciArIGxlbjJfYnl0ZSwgc3RhcnQxX2FkZHIgKyBsZW4xX2J5dGUsIGxlbl9taWQpOworCSAgbWVt Y3B5IChzdGFydDFfYWRkciwgdGVtcCwgbGVuMl9ieXRlKTsKIAkgIFNBRkVfRlJFRSAoKTsKIAot ICAgICAgICAgIGdyYWZ0X2ludGVydmFsc19pbnRvX2J1ZmZlciAodG1wX2ludGVydmFsMSwgZW5k MiAtIGxlbjEsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsZW4xLCBj dXJyZW50X2J1ZmZlciwgMCk7Ci0gICAgICAgICAgZ3JhZnRfaW50ZXJ2YWxzX2ludG9fYnVmZmVy ICh0bXBfaW50ZXJ2YWxfbWlkLCBzdGFydDEgKyBsZW4yLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgbGVuX21pZCwgY3VycmVudF9idWZmZXIsIDApOwotICAgICAgICAg IGdyYWZ0X2ludGVydmFsc19pbnRvX2J1ZmZlciAodG1wX2ludGVydmFsMiwgc3RhcnQxLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGVuMiwgY3VycmVudF9idWZmZXIs IDApOwotICAgICAgICB9CisJICBncmFmdF9pbnRlcnZhbHNfaW50b19idWZmZXIgKHRtcF9pbnRl cnZhbDEsIGVuZDIgLSBsZW4xLAorCQkJCSAgICAgICBsZW4xLCBjdXJyZW50X2J1ZmZlciwgMCk7 CisJICBncmFmdF9pbnRlcnZhbHNfaW50b19idWZmZXIgKHRtcF9pbnRlcnZhbF9taWQsIHN0YXJ0 MSArIGxlbjIsCisJCQkJICAgIC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cnZhbHNfaW50 b19idWZmZXIgKHRtcF9pbnRlcnZhbDEsIGVuZDIgLSBsZW4xLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbGVuMSwgY3VycmVudF9idWZmZXIsIDApOwotICAgICAgICAg IGdyYWZ0X2ludGVydmFsc19pbnRvX2J1ZmZlciAodG1wX2ludGVydmFsX21pZCwgc3RhcnQxICsg bGVuMiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGxlbl9taWQsIGN1 cnJlbnRfYnVmZmVyLCAwKTsKLSAgICAgICAgICBncmFmdF9pbnRlcnZhbHNfaW50b19idWZmZXIg KHRtcF9pbnRlcnZhbDIsIHN0YXJ0MSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGxlbjIsIGN1cnJlbnRfYnVmZmVyLCAwKTsKLSAgICAgICAgfQorCSAgZ3JhZnRfaW50 ZXJ2YWxzX2ludG9fYnVmZmVyICh0bXBfaW50ZXJ2YWwxLCBlbmQyIC0gbGVuMSwKKwkJCQkgICAg ICAgbGVuMSwgY3VycmVudF9idWZmZXIsIDApOworCSAgZ3JhZnRfaW50ZXJ2YWxzX2ludG9fYnVm ZmVyICh0bXBfaW50ZXJ2YWxfbWlkLCBzdGFydDEgKyBsZW4yLAorCQkJCSAgICAgICBsZW5fbWlk LCBjdXJyZW50X2J1ZmZlciwgMCk7CisJICBncmFmdF9pbnRlcnZhbHNfaW50b19idWZmZXIgKHRt cF9pbnRlcnZhbDIsIHN0YXJ0MSwKKwkJCQkgICAgICAgbGVuMiwgY3VycmVudF9idWZmZXIsIDAp OworCX0KIAogICAgICAgdXBkYXRlX2NvbXBvc2l0aW9ucyAoc3RhcnQxLCBzdGFydDEgKyBsZW4y LCBDSEVDS19CT1JERVIpOwogICAgICAgdXBkYXRlX2NvbXBvc2l0aW9ucyAoZW5kMiAtIGxlbjEs IGVuZDIsIENIRUNLX0JPUkRFUik7CmRpZmYgLS1naX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W5kX3Jl c3QsIFFhcmdzKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvYywKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgIGxpc3Q0IChRYXBwbHksCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgbGlzdDIgKFFmdW5jdGlvbiwgUWludGVybmFsX19tb2R1bGVfY2FsbCksCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZW52b2JqLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFFhcmdzKSk7CisJCQkgICBsaXN0MiAoUWFuZF9yZXN0LCBRYXJncyks CisJCQkgICBkb2MsCisJCQkgICBsaXN0NCAoUWFwcGx5LAorCQkJCSAgbGlzdDIgKFFmdW5jdGlv biwgUWludGVybmFsX19tb2R1bGVfY2FsbCksCisJCQkJICBlbnZvYmosCisJCQkJICBRYXJncykp OwogCiAgIHJldHVybiBsaXNwX3RvX3ZhbHVlIChyZXQpOwogfQpAQCAtNjY3LDcgKzY2Nyw3IEBA IERFRlVOICgibW9kdWxlLWxvYWQiLCBGbW9kdWxlX2xvYWQsIFNtb2R1bGVfbG9hZCwgMSwgMSwg MCwKICAgaWYgKHIgIT0gMCkKICAgICB7CiAgICAgICBpZiAoRklYTlVNX09WRVJGTE9XX1AgKHIp KQotICAgICAgICB4c2lnbmFsMCAoUW92ZXJmbG93X2Vycm9yKTsKKwl4c2lnbmFsMCAoUW92ZXJm bG93X2Vycm9yKTsKICAgICAgIHhzaWduYWwyIChRbW9kdWxlX2xvYWRfZmFpbGVkLCBmaWxlLCBt YWtlX251bWJlciAocikpOwogICAgIH0KIApAQCAtNzI3LDE3ICs3MjcsMTcgQEAgdXNhZ2U6ICht b2R1bGUtY2FsbCBFTlZPQkogJnJlc3QgQVJHTElTVCkgICAqLykKICAgICAgIHJldHVybiB2YWx1 ZV90b19saXNwIChyZXQpOwogICAgIGNhc2UgZW1hY3NfZnVuY2FsbF9leGl0X3NpZ25hbDoK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3ZhbHVlIHZhbHVlLAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjaGFyICpidWZmZXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0 cmRpZmZfdCAqc2l6ZV9pbm91dCk7CisJCQkJZW1hY3NfdmFsdWUgdmFsdWUsCisJCQkJY2hhciAq YnVmZmVyLAorCQkJCXB0cmRpZmZfdCAqc2l6ZV9pbm91dCk7CiAKICAgLyogQ3JlYXRlIGEgTGlz cCBzdHJpbmcgZnJvbSBhIHV0ZjggZW5jb2RlZCBzdHJpbmcuICAqLwogICBlbWFjc192YWx1ZSAo Km1ha2Vfc3RyaW5nKSAoZW1hY3NfZW52ICplbnYsCmRpZmYgLS1naXQgYS9zcmMvZW1hY3MuYyBi L3NyYy9lbWFjcy5jCmluZGV4IGVmZjNmOWQuLjRhM2U2ODEgMTAwNjQ0Ci0tLSBhL3NyYy9lbWFj cy5jCisrKyBiL3NyYy9lbWFjcy5jCkBAIC0yNDMsOCArMjQzLDggQEAgSW5pdGlhbGl6YXRpb24g b3B0aW9uczpcblwKICIsCiAgICAgIlwKIC0tcXVpY2ssIC1RICAgICAgICAgICAgICAgICBlcXVp dmFsZW50IHRvOlxuXAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLXEgLS1uby1zaXRl LWZpbGUgLS1uby1zaXRlLWxpc3AgLS1uby1zcGxhc2hcblwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIC0tbm8teC1yZXNvdXJjZXNcblwKKwkJCSAgICAgIC1xIC0tbm8tc2l0ZS1maWxl IC0tbm8tc2l0ZS1saXNwIC0tbm8tc3BsYXNoXG5cCisJCQkgICAgICAtLW5vLXgtcmVzb3VyY2Vz XG5cCiAtLXNjcmlwdCBGSUxFICAgICAgICAgICAgICAgcnVuIEZJTEUgYXMgYW4gRW1hY3MgTGlz cCBzY3JpcHRcblwKIC0tdGVybWluYWwsIC10IERFVklDRSAgICAgICB1c2UgREVWSUNFIGZvciB0 ZXJtaW5hbCBJL09cblwKIC0tdXNlciwgLXUgVVNFUiAgICAgICAgICAgICBsb2FkIH5VU0VSLy5l bWFjcyBpbnN0ZWFkIG9mIHlvdXIgb3duXG5cCkBAIC0yNzUsMTUgKzI3NSwxNSBAQCBEaXNwbGF5 IG9wdGlvbnM6XG5cCiBcblwKIC0tYmFja2dyb3VuZC1jb2xvciwgLWJnIENPTE9SICAgd2luZG93 IGJhY2tncm91bmQgY29sb3JcblwKIC0tYmFzaWMtZGlzcGxheSwgLUQgICAgICAgICAgICAgZGlz YWJsZSBtYW55IGRpc3BsYXkgZmVhdHVyZXM7XG5cCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgdXNlZCBmb3IgZGVidWdnaW5nIEVtYWNzXG5cCisJCQkJICB1c2VkIGZvciBkZWJ1 Z2dpbmcgRW1hY3NcblwKIC0tYm9yZGVyLWNvbG9yLCAtYmQgQ09MT1IgICAgICAgbWFpbiBib3Jk ZXIgY29sb3JcblwKIC0tYm9yZGVyLXdpZHRoLCAtYncgV0lEVEggICAgICAgd2lkdGggb2YgbWFp biBib3JkZXJcblwKICIsCiAgICAgIlwKIC0tY29sb3IsIC0tY29sb3I9TU9ERSAgICAgICAgICAg b3ZlcnJpZGUgY29sb3IgbW9kZSBmb3IgY2hhcmFjdGVyIHRlcm1pbmFscztcblwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBNT0RFIGRlZmF1bHRzIHRvIGBhdXRvJywgYW5kXG5c Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2FuIGFsc28gYmUgYG5ldmVyJywg YGFsd2F5cycsXG5cCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgb3IgYSBtb2Rl IG5hbWUgbGlrZSBgYW5zaTgnXG5cCisJCQkJICBNT0RFIGRlZmF1bHRzIHRvIGBhdXRvJywgYW5k XG5cCisJCQkJICBjYW4gYWxzbyBiZSBgbmV2ZXInLCBgYWx3YX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RpbmcgLmVtYWNzIChpbml0aWFsaXphdGlvbikuCi0gICAgICAgICAgICAgT1RPSCBpbml0 aWFsaXphdGlvbiBtYXkgc3RhcnQgc3VicHJvY2Vzc2VzIChlLmcuIGlzcGVsbCkgYW5kIHRoZXNl Ci0gICAgICAgICAgICAgc2hvdWxkIGJlIHJ1biBmcm9tIHRoZSBwcm9wZXIgcHJvY2VzcyAodGhl IG9uZSB0aGF0IHdpbGwgZW5kIHVwCi0gICAgICAgICAgICAgcnVubmluZyBhcyBkYWVtb24pIGFu ZCB3aXRoIHRoZSBwcm9wZXIgInNlc3Npb24gaWQiIGluIG9yZGVyIGZvcgotICAgICAgICAgICAg IHRoZW0gdG8ga2VlcCB3b3JraW5nIGFmdGVyIGRldGFjaGluZywgc28gZm9yayBhbmQgc2V0c2lk IG5lZWQgdG8gYmUKLSAgICAgICAgICAgICBwZXJmb3JtZWQgYmVmb3JlIGluaXRpYWxpemF0aW9u LgotCi0gICAgICAgICAgICAgV2Ugd2FudCB0byBhdm9pZCBleGl0aW5nIGJlZm9yZSB0aGUgc2Vy dmVyIHNvY2tldCBpcyByZWFkeSwgc28KLSAgICAgICAgICAgICB1c2UgYSBwaXBlIGZvciBzeW5j aHJvbml6YXRpb24uICBUaGUgcGFyZW50IHdhaXRzIGZvciB0aGUgY2hpbGQKLSAgICAgICAgICAg ICB0byBjbG9zZSBpdHMgZW5kIG9mIHRoZSBwaXBlICh1c2luZyBgZGFlbW9uLWluaXRpYWxpemVk JykKLSAgICAgICAgICAgICBiZWZvcmUgZXhpdGluZy4gICovCi0gICAgICAgICAgaWYgKGVtYWNz X3BpcGUgKGRhZW1vbl9waXBlKSAhPSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBm cHJpbnRmIChzdGRlcnIsICJDYW5ub3QgcGlwZSFcbiIpOwotICAgICAgICAgICAgICBleGl0ICgx KTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfSAvKiBkYWVtb25fdHlwZSA9PSAyICovCisJewor C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iAgICAgICBpZiAoZGFlbW9uX3R5cGUgPT0gMikKLSAg ICAgICAgewotICAgICAgICAgIHBpZF90IGY7CisJeworCSAgcGlkX3QgZjsKICNpZm5kZWYgREFF TU9OX01VU1RfRVhFQwogCi0gICAgICAgICAgZiA9IGZvcmsgKCk7CisJICBmID0gZm9yayAoKTsK ICNlbHNlIC8qIERBRU1PTl9NVVNUX0VYRUMgKi8KLSAgICAgICAgICBpZiAoIWRuYW1lX2FyZyB8 fCAhc3RyY2hyIChkbmFtZV9hcmcsICdcbicpKQotICAgICAgICAgICAgZiA9IGZvcmsgKCk7ICAv KiBpbiBvcmlnICovCi0gICAgICAgICAgZWxzZQotICAgICAgICAgICAgZiA9IDA7ICAvKiBpbiBl eGVjJ2QgKi8KKwkgIGlmICghZG5hbWVfYXJnIHx8ICFzdHJjaHIgKGRuYW1lX2FyZywgJ1xuJykp CisJICAgIGYgPSBmb3JrICgpOyAgLyogaW4gb3JpZyAqLworCSAgZWxzZQorCSAgICBmID0gMDsg IC8qIGluIGV4ZWMnZCAqLwogI2VuZGlmIC8qICFEQUVNT05fTVVTVF9FWEVDICovCi0gICAgICAg ICAgaWYgKGYgPiAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBpbnQgcmV0dmFsOwot ICAgICAgICAgICAgICBjaGFyIGJ1ZlsxXTsKLQotICAgICAgICAgICAgICAvKiBDbG9zZSB1bnVz ZWQgd3JpdGluZyBlbmQgb2YgdGhlIHBpcGUuICAqLwotICAgICAgICAgICAgICBlbWFjc19jbG9z ZSAoZGFlbW9uX3BpcGVbMV0pOwotCi0gICAgICAgICAgICAgIC8qIEp1c3Qgd2FpdCBmb3IgdGhl IGNoaWxkIHRvIGNsb3NlIGl0cyBlbmQgb2YgdGhlIHBpcGUuICAqLwotICAgICAgICAgICAgICBk bwotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHJldHZhbCA9IHJlYWQgKGRh ZW1vbl9waXBlWzBdLCAmYnVmLCAxKTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAg IHdoaWxlIChyZXR2YWwgPT0gLTEgJiYgZXJybm8gPT0gRUlOVFIpOwotCi0gICAgICAgICAgICAg IGlmIChyZXR2YWwgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGZw cmludGYgKHN0ZGVyciwgIkVycm9yIHJlYWRpbmcgc3RhdHVzIGZyb20gY2hpbGRcbiIpOwotICAg ICAgICAgICAgICAgICAgZXhpdCAoMSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAg ICBlbHNlIGlmIChyZXR2YWwgPT0gMCkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAg ICAgICBmcHJpbnRmIChzdGRlcnIsICJFcnJvcjogc2VydmVyIGRpZCBub3Qgc3RhcnQgY29ycmVj dGx5XG4iKTsKLSAgICAgICAgICAgICAgICAgIGV4aXQgKDEpOwotICAgICAgICAgICAgICAgIH0K LQotICAgICAgICAgICAgICBlbWFjc19jbG9zZSAoZGFlbW9uX3BpcGVbMF0pOwotICAgICAgICAg ICAgICBleGl0ICgwKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICBpZiAoZiA8IDApCi0gICAg ICAgICAgICB7Ci0gICAgICAgICAgICAgIGVtYWNzX3BlcnJvciAoImZvcmsiKTsKLSAgICAgICAg ICAgICAgZXhpdCAoRVhJVF9DQU5DRUxFRCk7Ci0gICAgICAgICAgICB9CisJICBpZiAoZiA+IDAp CisJICAgIHsKKwkgICAgICBpbnQgcmV0dmFsOworCSAgICAgIGNoYXIgYnVmWzFdOworCisJICAg ICAgLyogQ2xvc2UgdW51c2VkIHdyaXRpbmcgZW5kIG9mIHRoZSBwaXBlLiAgKi8KKwkgICAgICBl bWFjc19jbG9zZSAoZGFlbW9uX3BpcGVbMV0pOworCisJICAgICAgLyogSnVzdCB3YWl0IGZvciB0 aGUgY2hpbGQgdG8gY2xvc2UgaXRzIGVuZCBvZiB0aGUgcGlwZS4gICovCisJICAgICAgZG8KKwkJ eworCQkgIHJldHZhbCA9IHJlYWQgKGRhZW1vbl9waXBlWzBdLCAmYnVmLCAxKTsKKwkJfQorCSAg ICAgIHdoaWxlIChyZXR2YWwgPT0gLTEgJiYgZXJybm8gPT0gRUlOVFIpOworCisJICAgICAgaWYg KHJldHZhbCA8IDApCisJCXsKKwkJICBmcHJpbnRmIChzdGRlcnIsICJFcnJvciByZWFkaW5nIHN0 YXR1cyBmcm9tIGNoaWxkXG4iKTsKKwkJICBleGl0ICgxKTsKKwkJfQorCSAgICAgIGVsc2UgaWYg KHJldHZhbCA9PSAwKQorCQl7CisJCSAgZnByaW50ZiAoc3RkZXJyLCAiRXJyb3I6IHNlcnZlciBk aWQgbm90IHN0YXJ0IGNvcnJlY3RseVxuIik7CisJCSAgZXhpdCAoMSk7CisJCX0KKworCSAgICAg IGVtYWNzX2Nsb3NlIChkYWVtb25fcGlwZVswXSk7CisJICAgICAgZXhpdCAoMCk7CisJICAgIH0K KwkgIGlmIChmIDwgMCkKKwkgICAgeworCSAgICAgIGVtYWNzX3BlcnJvciAoImZvcmsiKTsKKwkg ICAgICBleGl0IChFWElUX0NBTkNFTEVEKTsKKwkgICAgfQogCiAjaWZkZWYgREFFTU9OX01VU1Rf RVhFQwotICAgICAgICAgIHsKLSAgICAgICAgICAgIC8qIEluIG9yaWcgcHJvY2VzcywgZm9ya2Vk IGFzIGNoaWxkLCBPUiBpbiBleGVjJ2QuICovCi0gICAgICAgICAgICBpZiAoIWRuYW1lX2FyZyB8 fCAhc3RyY2hyIChkbmFtZV9hcmcsICdcbicpKQotICAgICAgICAgICAgICB7ICAvKiBJbiBvcmln LCBjaGlsZDogbm93IGV4ZWMgdy9zcGVjaWFsIGRhZW1vbiBuYW1lLiAqLwotICAgICAgICAgICAg ICAgIGNoYXIgZmRTdHJbODBdOwotICAgICAgICAgICAgICAgIGludCBmZFN0cmxlbiA9Ci0gICAg ICAgICAgICAgICAgICBzbnByaW50ZiAoZmRTdHIsIHNpemVvZiBmZFN0ciwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAiLS1vbGQtZGFlbW9uPVxuJWQsJWRcbiVzIiwgZGFlbW9uX3BpcGVb MF0sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgZGFlbW9uX3BpcGVbMV0sIGRuYW1lX2Fy ZyA/IGRuYW1lX2FyZyA6ICIiKTsKLQotICAgICAgICAgICAgICAgIGlmICghICgwIDw9IGZkU3Ry bGVuICYmIGZkU3RybGVuIDwgc2l6ZW9mIGZkU3RyKSkKLSAgICAgICAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiZGFlbW9uOiBjaGlsZCBuYW1lIHRv byBsb25nXG4iKTsKLSAgICAgICAgICAgICAgICAgICAgZXhpdCAoRVhJVF9DQU5OT1RfSU5WT0tF KTsKLSAgICAgICAgICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAgIGFyZ3Zbc2tpcF9hcmdz XSA9IGZkU3RyOwotCi0gICAgICAgICAgICAgICAgZmNudGwgKGRhZW1vbl9waXBlWzBdLCBGX1NF VEZELCAwKTsKLSAgICAgICAgICAgICAgICBmY250bCAoZGFlbW9uX3BpcGVbMV0sIEZfU0VURkQs IDApOwotICAgICAgICAgICAgICAgIGV4ZWN2cCAoYXJndlswXSwgYXJndik7Ci0gICAgICAgICAg ICAgICAgZW1hY3NfcGVycm9yIChhcmd2WzBdKTsKLSAgICAgICAgICAgICAgICBleGl0IChlcnJu byA9PSBFTk9FTlQgPyBFWElUX0VOT0VOVCA6IEVYSVRfQ0FOTk9UX0lOVk9LRSk7Ci0gICAgICAg ICAgICAgIH0KLQotICAgICAgICAgICAgLyogSW4gZXhlYydkOiBwYXJzZSBzcGVjaWFsIGRuYW1l IGludG8gcGlwZSBhbmQgbmFtZSBpbmZvLiAqLwotICAgICAgICAgICAgaWYgKCFkbmFtZV9hcmcg fHwgIXN0cmNociAoZG5hbWVfYX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P QQogICAgICAgLyogU3RhcnRlZCBmcm9tIEdVST8gKi8KICAgICAgIC8qIEZJWE1FOiBEbyB0aGUg cmlnaHQgdGhpbmcgaWYgZ2V0ZW52IHJldHVybnMgTlVMTCwgb3IgaWYKLSAgICAgICAgIGNoZGly IGZhaWxzLiAgKi8KKwkgY2hkaXIgZmFpbHMuICAqLwogICAgICAgaWYgKCEgaW5oaWJpdF93aW5k b3dfc3lzdGVtICYmICEgaXNhdHR5IChTVERJTl9GSUxFTk8pICYmICEgY2hfdG9fZGlyKQotICAg ICAgICBjaGRpciAoZ2V0ZW52ICgiSE9NRSIpKTsKKwljaGRpciAoZ2V0ZW52ICgiSE9NRSIpKTsK ICAgICAgIGlmIChza2lwX2FyZ3MgPCBhcmdjKQotICAgICAgICB7Ci0gICAgICAgICAgaWYgKCFz dHJuY21wIChhcmd2W3NraXBfYXJnc10sICItcHNuIiwgNCkpCi0gICAgICAgICAgICB7Ci0gICAg ICAgICAgICAgIHNraXBfYXJncyArPSAxOwotICAgICAgICAgICAgICBpZiAoISBjaF90b19kaXIp IGNoZGlyIChnZXRlbnYgKCJIT01FIikpOwotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2Ug aWYgKHNraXBfYXJncysxIDwgYXJnYyAmJiAhc3RybmNtcCAoYXJndltza2lwX2FyZ3MrMV0sICIt cHNuIiwgNCkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHNraXBfYXJncyArPSAyOwot ICAgICAgICAgICAgICBpZiAoISBjaF90b19kaXIpIGNoZGlyIChnZXRlbnYgKCJIT01FIikpOwot ICAgICAgICAgICAgfQotICAgICAgICB9CisJeworCSAgaWYgKCFzdHJuY21wIChhcmd2W3NraXBf YXJnc10sICItcHNuIiwgNCkpCisJICAgIHsKKwkgICAgICBza2lwX2FyZ3MgKz0gMTsKKwkgICAg ICBpZiAoISBjaF90b19kaXIpIGNoZGlyIChnZXRlbnYgKCJIT01FIikpOworCSAgICB9CisJICBl bHNlIGlmIChza2l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NzX2Rpci4gICovCi0gICAgICAgICAgaWYgKGVkaXIgJiYgZGVmYXVsdGVk Ci0gICAgICAgICAgICAgICYmIHN0cm5jbXAgKHBhdGgsIGVtYWNzX2Rpcl9lbnYsIGVtYWNzX2Rp cl9sZW4pID09IDApCi0gICAgICAgICAgICBlbGVtZW50ID0gRmV4cGFuZF9maWxlX25hbWUgKEZz dWJzdHJpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKGVsZW1l bnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtYWtlX251bWJl ciAoZW1hY3NfZGlyX2xlbiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBRbmlsKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVp bGRfdW5pYnl0ZV9zdHJpbmcgKGVtYWNzX2RpcikpOwotI2VuZGlmCi0KLSAgICAgICAgICAvKiBB ZGQgLzogdG8gdGhlIGZyb250IG9mIHRoZSBuYW1lCi0gICAgICAgICAgICAgaWYgaXQgd291bGQg b3RoZXJ3aXNlIGJlIHRyZWF0ZWQgYXMgbWFnaWMuICAqLwotICAgICAgICAgIHRlbSA9IEZmaW5k X2ZpbGVfbmFtZV9oYW5kbGVyIChlbGVtZW50LCBRdCk7Ci0KLSAgICAgICAgICAvKiBIb3dldmVy LCBpZiB0aGUgaGFuZGxlciBzYXlzICJJJ20gc2FmZSIsCi0gICAgICAgICAgICAgZG9uJ3QgYm90 aGVyIGFkZGluZyAvOi4gICovCi0gICAgICAgICAgaWYgKFNZTUJPTFAgKHRlbSkpCi0gICAgICAg ICAgICB7Ci0gICAgICAgICAgICAgIExpc3BfT2JqZWN0IHByb3A7Ci0gICAgICAgICAgICAgIHBy b3AgPSBGZ2V0ICh0ZW0sIGludGVybiAoInNhZmUtbWFnaWMiKSk7Ci0gICAgICAgICAgICAgIGlm ICghIE5JTFAgKHByb3ApKQot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ICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBnaW50ICAgICAgKm5hdHVyYWwpOworCQkJCQkgICAgICBnaW50ICAgICAgKm1pbmltdW0s CisJCQkJCSAgICAgIGdpbnQgICAgICAqbmF0dXJhbCk7CiBzdGF0aWMgdm9pZCBlbWFjc19maXhl ZF9nZXRfcHJlZmVycmVkX2hlaWdodCAoR3RrV2lkZ2V0ICp3aWRnZXQsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZ2ludCAgICAgICptaW5pbXVtLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGdpbnQgICAgICAqbmF0 dXJhbCk7CisJCQkJCSAgICAgIGdpbnQgICAgICAqbWluaW11bSwKKwkJCQkJICAgICAgZ2ludCAg ICAgICpuYXR1cmFsKTsKIHN0YXRpYyBHVHlwZSBlbWFjc19maXhlZF9nZXRfdHlwZSAodm9pZCk7 CiBHX0RFRklORV9UWVBFIChFbWFjc0ZpeGVkLCBlbWFjc19maXhlZCwgR1RLX1RZUEVfRklYRUQp CiAKQEAgLTk5LDExICs5OSwxMSBAQCBlbWFjc19maXhlZF9ndGtfd2lkZ2V0X3NpemVfYWxsb2Nh dGUgKEd0a1dpZGdldCAqd2lkZ2V0LAogICBpZiAoZ3RrX3dpZGdldF9nZXRfaGFzX3dpbmRvdyAo d2lkZ2V0KSkKICAgICB7CiAgICAgICBpZiAoZ3RrX3dpZGdldF9nZXRfcmVhbGl6ZWQgKHdpZGdl dCkpCi0gICAgICAgIGdka193aW5kb3dfbW92ZV9yZXNpemUgKGd0a193aWRnZXRfZ2V0X3dpbmRv dyAod2lkZ2V0KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGlvbi0+ eCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2NhdGlvbi0+eSwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgYWxsb2N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fT2JqZWN0IGtpbmQgPSBGbnRoIChtYWtlX251bWJlciAoNCksIGZ1bmRlZik7CiAg ICAgICBpZiAoISAoRVEgKGtpbmQsIFF0KSB8fCBFUSAoa2luZCwgUW1hY3JvKSkpCi0gICAgICAg IHsKLSAgICAgICAgICBmcHJpbnRmKHN0ZGVyciwgIm5pbCIpOwotICAgICAgICB9CisJeworCSAg ZnByaW50ZihzdGRlcnIsICJuaWwiKTsKKwl9CiAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAg ICAgICBmcHJpbnRmKHN0ZGVyciwgInQiKTsKLSAgICAgICAgfQorCXsKKwkgIGZwcmludGYoc3Rk ZXJyLCAidCIpOworCX0KICAgICAgIGZwcmludGYoc3RkZXJyLCAiKVxuIik7CiAgICAgfQogCkBA IC0yODAzLDU3ICsyODAzLDU3IEBAIGZ1bmNhbGxfc3ViciAoc3RydWN0IExpc3BfU3ViciAqc3Vi ciwgcHRyZGlmZl90IG51bWFyZ3MsIExpc3BfT2JqZWN0ICphcmdzKQogICAgICAgTGlzcF9PYmpl Y3QgaW50ZXJuYWxfYXJnYnVmWzhdOwogICAgICAgTGlzcF9PYmplY3QgKmludGVybmFsX2FyZ3M7 CiAgICAgICBpZiAoc3Vici0+bWF4X2FyZ3MgPiBudW1hcmdzKQotICAgICAgICB7Ci0gICAgICAg ICAgZWFzc2VydCAoc3Vici0+bWF4X2FyZ3MgPD0gQVJSQVlFTFRTIChpbnRlcm5hbF9hcmdidWYp KTsKLSAgICAgICAgICBpbnRlcm5hbF9hcmdzID0gaW50ZXJuYWxfYXJnYnVmOwotICAgICAgICAg IG1lbWNweSAoaW50ZXJuYWxfYXJncywgYXJncywgbnVtYXJncyAqIHdvcmRfc2l6ZSk7Ci0gICAg ICAgICAgbWVtY2xlYXIgKGludGVybmFsX2FyZ3MgKyBudW1hcmdzLAotICAgICAgICAgICAgICAg ICAgICAoc3Vici0+bWF4X2FyZ3MgLSBudW1hcmdzKSAqIHdvcmRfc2l6ZSk7Ci0gICAgICAgIH0K Kwl7CisJICBlYXNzZXJ0IChzdWJyLT5tYXhfYXJncyA8PSBBUlJBWUVMVFMgKGludGVybmFsX2Fy Z2J1ZikpOworCSAgaW50ZXJuYWxfYXJncyA9IGludGVybmFsX2FyZ2J1ZjsKKwkgIG1lbWNweSAo aW50ZXJuYWxfYXJncywgYXJncywgbnVtYXJncyAqIHdvcmRfc2l6ZSk7CisJICBtZW1jbGVhciAo aW50ZXJuYWxfYXJncyArIG51bWFyZ3MsCisJCSAgICAoc3Vici0+bWF4X2FyZ3MgLSBudW1hcmdz KSAqIHdvcmRfc2l6ZSk7CisJfQogICAgICAgZWxzZQotICAgICAgICBpbnRlcm5hbF9hcmdzID0g YXJnczsKKwlpbnRlcm5hbF9hcmdzID0gYXJnczsKICAgICAgIHN3aXRjaCAoc3Vici0+bWF4X2Fy Z3MpCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSAwOgotICAgICAgICAgIHJldHVybiAoc3Vici0+ ZnVuY3Rpb24uYTAgKCkpOwotICAgICAgICBjYXNlIDE6Ci0gICAgICAgICAgcmV0dXJuIChzdWJy LT5mdW5jdGlvbi5hMSAoaW50ZXJuYWxfYXJnc1swXSkpOwotICAgICAgICBjYXNlIDI6Ci0gICAg ICAgICAgcmV0dXJuIChzdWJyLT5mdW5jdGlvbi5hMgotICAgICAgICAgICAgICAgICAgKGludGVy bmFsX2FyZ3NbMF0sIGludGVybmFsX2FyZ3NbMV0pKTsKLSAgICAgICAgY2FzZSAzOgotICAgICAg ICAgIHJldHVybiAoc3Vici0+ZnVuY3Rpb24uYTMKLSAgICAgICAgICAgICAgICAgIChpbnRlcm5h bF9hcmdzWzBdLCBpbnRlcm5hbF9hcmdzWzFdLCBpbnRlcm5hbF9hcmdzWzJdKSk7Ci0gICAgICAg IGNhc2UgNDoKLSAgICAgICAgICByZXR1cm4gKHN1YnItPmZ1bmN0aW9uLmE0Ci0gICAgICAgICAg ICAgICAgICAoaW50ZXJuYWxfYXJnc1swXSw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d2l0Y2ggKHRoaXNfYmluZGluZy0+a2luZCkKQEAgLTM0MDAsNyArMzQwMCw3 IEBAIGRvX29uZV91bmJpbmQgKHVuaW9uIHNwZWNiaW5kaW5nICp0aGlzX2JpbmRpbmcsIGJvb2wg dW53aW5kaW5nLAogCSAgICAgIFNFVF9TWU1CT0xfVkFMIChYU1lNQk9MIChzeW0pLCBzcGVjcGRs X29sZF92YWx1ZSAodGhpc19iaW5kaW5nKSk7CiAJICAgIGVsc2UKIAkgICAgICBzZXRfaW50ZXJu YWwgKHN5bSwgc3BlY3BkbF9vbGRfdmFsdWUgKHRoaXNfYmluZGluZyksCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgUW5pbCwgYmluZGZsYWcpOworCQkJICAgIFFuaWwsIGJpbmRmbGFnKTsK IAkgICAgYnJlYWs7CiAJICB9CiAJZWxzZQpAQCAtMzQxMSw4ICszNDExLDggQEAgZG9fb25lX3Vu YmluZCAodW5pb24gc3BlY2JpbmRpbmcgKnRoaXNfYmluZGluZywgYm9vbCB1bndpbmRpbmcsCiAg ICAgICB9CiAgICAgY2FzZSBTUEVDUERMX0xFVF9ERUZBVUxUOgogICAgICAgc2V0X2RlZmF1bHRf aW50ZXJuYWwgKHNwZWNwZGxfc3ltYm9sICh0aGlzX2JpbmRpbmcpLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNwZWNwZGxfb2xkX3ZhbHVlICh0aGlzX2JpbmRpbmcpLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGJpbmRmbGFnKTsKKwkJCSAgICBzcGVjcGRsX29sZF92YWx1ZSAo dGhpc19iaW5kaW5nKSwKKwkJCSAgICBiaW5kZmxhZyk7CiAgICAgICBicmVhazsKICAgICBjYXNl IFNQRUNQRExfTEVUX0xPQ0FMOgogICAgICAgewpAQCAtMzQyNCw3ICszNDI0LDcgQEAgZG9fb25l X3VuYmluZCAodW5pb24gc3BlY2JpbmRpbmcgKnRoaXNfYmluZGluZywgYm9vbCB1bnd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mUgdGhlIHN5bWxpbmsuCiBJZiBmaWxlIGhhcyBtdWx0aXBsZSBuYW1lcywg aXQgY29udGludWVzIHRvIGV4aXN0IHdpdGggdGhlIG90aGVyIG5hbWVzLgogVFJBU0ggbm9uLW5p bCBtZWFucyB0byB0cmFzaCB0aGUgZmlsZSBpbnN0ZWFkIG9mIGRlbGV0aW5nLCBwcm92aWRlZApA QCAtMjQwMSwxMSArMjQwMSwxMSBAQCBUaGlzIGlzIHdoYXQgaGFwcGVucyBpbiBpbnRlcmFjdGl2 ZSB1c2Ugd2l0aCBNLXguICAqLykKICAgICAgIGludCByZW5hbWVfZXJybm8gPSBlcnJubzsKICAg ICAgIGlmIChyZW5hbWVfZXJybm8gPT0gRVhERVYpCiAJewotICAgICAgICAgIHB0cmRpZmZfdCBj b3VudDsKLSAgICAgICAgICBzeW1saW5rX3RhcmdldCA9IEZmaWxlX3N5bWxpbmtfcCAoZmlsZSk7 Ci0gICAgICAgICAgaWYgKCEgTklMUCAoc3ltbGlua190YXJnZXQpKQotICAgICAgICAgICAgRm1h a2Vfc3ltYm9saWNfbGluayAoc3ltbGlua190YXJnZXQsIG5ld25hbWUsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBOSUxQIChva19pZl9hbHJlYWR5X2V4aXN0cykgPyBRbmlsIDog UXQpOworCSAgcHRyZGlmZl90IGNvdW50OworCSAgc3ltbGlua190YXJnZXQgPSBGZmlsZV9zeW1s aW5rX3AgKGZpbGUpOworCSAgaWYgKCEgTklMUCAoc3ltbGlua190YXJnZXQpKQorCSAgICBGbWFr ZV9zeW1ib2xpY19saW5rIChzeW1saW5rX3RhcmdldCwgbmV3bmFtZSwKKwkJCQkgTklMUCAob2tf aWZfYWxyZWFkeV9leGlzdHMpID8gUW5pbCA6IFF0KTsKIAkgIGVsc2UgaWYgKCFOSUxQIChGZmls ZV9kaXJlY3RvcnlfcCAoZmlsZSkpKQogCSAgICBjYWxsNCAoUWNvcHlfZGlyZWN0b3J5LCB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emVvZiBsb2NrX2luZm9fc3RyLAorCQkgICAgICAgIiVzQCVzLiUicE1kIjolInBN ZCwKKwkJICAgICAgIHVzZXJfbmFtZSwgaG9zdF9uYW1lLCBwaWQsIGJvb3QpKQorCXJldHVybiBF TkFNRVRPT0xPTkc7CiAgICAgfQogICBlbHNlIGlmIChzaXplb2YgbG9ja19pbmZvX3N0cgotICAg ICAgICAgICA8PSBzbnByaW50ZiAobG9ja19pbmZvX3N0ciwgc2l6ZW9mIGxvY2tfaW5mb19zdHIs Ci0gICAgICAgICAgICAgICAgICAgICAgICAiJXNAJXMuJSJwTWQsCi0gICAgICAgICAgICAgICAg ICAgICAgICB1c2VyX25hbWUsIGhvc3RfbmFtZSwgcGlkKSkKKwkgICA8PSBzbnByaW50ZiAobG9j a19pbmZvX3N0ciwgc2l6ZW9mIGxvY2tfaW5mb19zdHIsCisJCQkiJXNAJXMuJSJwTWQsCisJCQl1 c2VyX25hbWUsIGhvc3RfbmFtZSwgcGlkKSkKICAgICByZXR1cm4gRU5BTUVUT09MT05HOwogCiAg IHJldHVybiBjcmVhdGVfbG9ja19maWxlIChsZm5hbWUsIGxvY2tfaW5mb19zdHIsIGZvcmNlKTsK QEAgLTU5MiwyMSArNTkyLDIxIEBAIGN1cnJlbnRfbG9ja19vd25lciAobG9ja19pbmZvX3R5cGUg Km93bmVyLCBjaGFyICpsZm5hbWUpCiAgICAgICAmJiBtZW1jbXAgKGF0ICsgMSwgU1NEQVRBIChz eXN0ZW1fbmFtZSksIFNCWVRFUyAoc3lzdGVtX25hbWUpKSA9PSAwKQogICAgIHsKICAgICAgIGlm IChwaWQgPT0gZ2V0cGlkICgpKQotICAgICAgICByZXQgPSAyOyAvKiBXZSBvd24gaXQuICAqLwor CXJldCA9IDI7IC8qIFdlIG93biBpdC4gICovCiAgICAgICBlbHNlIGlmICgwIDwgcGlkICYmIHBp ZCA8PSBUWVBFX01BWElNVU0gKHBpZF90KQotICAgICAgICAgICAgICAgJiYgKGtpbGwgKHBp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V4IHByb3AsIExpc3BfT2JqZWN0 IHZhbCwKLSAgICAgICAgICAgICAgICAgICAgIGJvb2wgbm9lcnJvcikKKwkJICAgICBib29sIG5v ZXJyb3IpCiB7CiAgIExpc3BfT2JqZWN0IHRhYmxlID0gQVJFRiAoZm9udF9zdHlsZV90YWJsZSwg cHJvcCAtIEZPTlRfV0VJR0hUX0lOREVYKTsKICAgaW50IGxlbjsKQEAgLTQwOSw3ICs0MDksNyBA QCBmb250X3N0eWxlX3RvX3ZhbHVlIChlbnVtIGZvbnRfcHJvcGVydHlfaW5kZXggcHJvcCwgTGlz cF9PYmplY3QgdmFsLAogCiBMaXNwX09iamVjdAogZm9udF9zdHlsZV9zeW1ib2xpYyAoTGlzcF9P YmplY3QgZm9udCwgZW51bSBmb250X3Byb3BlcnR5X2luZGV4IHByb3AsCi0gICAgICAgICAgICAg ICAgICAgICBib29sIGZvcl9mYWNlKQorCQkgICAgIGJvb2wgZm9yX2ZhY2UpCiB7CiAgIExpc3Bf T2JqZWN0IHZhbCA9IEFSRUYgKGZvbnQsIHByb3ApOwogICBMaXNwX09iamVjdCB0YWJsZSwgZWx0 OwpAQCAtNzI0LDkgKzcyNCw5IEBAIGZvbnRfcHV0X2V4dHJhIChMaXNwX09iamVjdCBmb250LCBM aXNwX09iamVjdCBwcm9wLCBMaXNwX09iamVjdCB2YWwpCiAJcHJldiA9IGV4dHJhLCBleHRyYSA9 IFhDRFIgKGV4dHJhKTsKIAogICAgICAgaWYgKE5JTFAgKHByZXYpKQotICAgICAgICBBU0VUIChm b250LCBGT05UX0VYVFJBX0lOREVYLCBGY29ucyAoRmNvbnMgKHByb3AsIHZhbCksIGV4dHJhKSk7 CisJQVNFVCAoZm9udCwgRk9OVF9FWFRSQV9JTkRFWCwgRmNvbnMgKEZjb25zIChwcm9wLCB2YWwp LCBleHRyYSkpOwogICAgICAgZWxzZQotICAgICAgICBYU0VUQ0RSIChwcmV2LCBGY29ucyAoRmNv bnMgKHByb3AsIHZhbCksIGV4dHJhKSk7CisJWFNFVENEUiAocHJldiwgRmNvbnMgKEZjb25zIChw cm9wLCB2YWwpLCBleHRyYSkpOwogCiAgICAgICByZXR1cm4gdmFsOwogICAgIH0KQEAgLTE0ODMs MjQgKzE0ODMsMjQgQEAgZm9udF9wYXJzZV9mY25hbWUgKGNoYXIgKm5hbWUsIHB0cmRpZmZfdCBs ZW4sIExpc3BfT2JqZWN0IGZvbnQpCiAKIAkJICBpZiAocHJvcCA+PSBGT05UX0ZPVU5EUllfSU5E RVgKIAkJICAgICAgJiYgcHJvcCA8IEZPTlRfRVhUUkFfSU5ERVgpCi0gICAgICAgICAgICAgICAg ICAgIEFTRVQgKGZvbnQsIHByb3AsIGZvbnRfcHJvcF92YWxpZGF0ZSAocHJvcCwgUW5pbCwgdmFs KSk7CisJCSAgICBBU0VUIChmb250LCBwcm9wLCBmb250X3Byb3BfdmFsaWRhdGUgKHByb3AsIFFu aWwsIHZhbCkpOwogCQkgIGVsc2UKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAg ICAgICAgICAgIGV4dHJhX3Byb3BzID0gbmNvbmMyIChleHRyYV9wcm9wcywKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbGlzdDEgKEZjb25zIChrZXksIHZhbCkp KTsKLSAgICAgICAgICAgICAgICAgICAgfQorCQkgICAgeworCQkgICAgICBleHRyYV9wcm9wcyA9 IG5jb25jMiAoZXh0cmFfcHJvcHMsCisJCQkJCSAgICBsaXN0MSAoRmNvbnMgKGtleSwgdmFsKSkp OworCQkgICAgfQogCQl9CiAJICAgICAgcCA9IHE7CiAJICAgIH0KIAl9CiAKICAgICAgIGlmICgh IE5JTFAgKGV4dHJhX3Byb3BzKSkKLSAgICAgICAgewotICAgICAgICAgIHN0cnVjdCBmb250X2Ry aXZlcl9saXN0ICpkcml2ZXJfbGlzdCA9IGZvbnRfZHJpdmVyX2xpc3Q7Ci0gICAgICAgICAgZm9y ICggOyBkcml2ZX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gIGNvbnN0IGNoYXIgKnN0ciA9IElOVEVHRVJQICh2YWwpID8g KFhJTlQgKHZhbCkgPyAidHJ1ZSIgOiAiZmFsc2UiKQogCSAgICAgIDogU1lNQk9MUCAodmFsKSA/ IFNTREFUQSAoU1lNQk9MX05BTUUgKHZhbCkpCiAJICAgICAgOiAidHJ1ZSI7CiAKLSAgICAgICAg ICAgIGlmIChzdHJjbXAgKCJmYWxzZSIsIHN0cikgPT0gMCB8fCBzdHJjbXAgKCJGYWxzZSIsIHN0 cikgPT0gMAotICAgICAgICAgICAgICAgIHx8IHN0cmNtcCAoIkZBTFNFIiwgc3RyKSA9PSAwIHx8 IHN0cmNtcCAoIkZjRmFsc2UiLCBzdHIpID09IDAKLSAgICAgICAgICAgICAgICB8fCBzdHJjbXAg KCJvZmYiLCBzdHIpID09IDAgfHwgc3RyY21wICgiT0ZGIiwgc3RyKSA9PSAwCi0gICAgICAgICAg ICAgICAgfHwgc3RyY21wICgiT2ZmIiwgc3RyKSA9PSAwKQotICAgICAgICAgICAgICB2YWwgPSBR bmlsOworCSAgICBpZiAoc3RyY21wICgiZmFsc2UiLCBzdHIpID09IDAgfHwgc3RyY21wICgiRmFs c2UiLCBzdHIpID09IDAKKwkJfHwgc3RyY21wICgiRkFMU0UiLCBzdHIpID09IDAgfHwgc3RyY21w ICgiRmNGYWxzZSIsIHN0cikgPT0gMAorCQl8fCBzdHJjbXAgKCJvZmYiLCBzdHIpID09IDAgfHwg c3RyY21wICgiT0ZGIiwgc3RyKSA9PSAwCisJCXx8IHN0cmNtcCAoIk9mZiIsIHN0cikgPT0gMCkK KwkgICAgICB2YWwgPSBRbmlsOwogCSAgICBlbHNlCi0gICAgICAgICAgICAgIHZhbCA9IFF0Owor CSAgICAgIHZhbCA9IFF0OwogCi0gICAgICAgICAgICBGZm9udF9wdXQgKGZvbnQsIGtleSwgdmFs KTsKLSAgICAgICAgICB9CisJICAgIEZmb250X3B1dCAoZm9udCwga2V5LCB2YWwpOworCSAgfQog ICAgICAgfQogCiAgIGZvciAoaSA9IDA7IG5vbl9ib29sZWFuX3Byb3BlcnRpZXNbaV0gIT0gTlVM TDsgKytpKQogICAgIGZvciAoaXQgPSBhbGlzdDsgISBOSUxQIChpdCk7IGl0ID0gWENEUiAoaXQp KQogICAgICAgewotICAgICAgICBMaXNwX09iamVjdCBrZXkgPSBYQ0FSIChYQ0FSIChpdCkpOwot ICAgICAgICBMaXNwX09iamVjdCB2YWwgPSBYQ0RSIChYQ0FSIChpdCkpOwotICAgICAgICBjaGFy ICprZXlzdHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChrZXkpKTsKLSAgICAgICAgaWYgKHN0cmNt cCAobm9uX2Jvb2xlYW5fcHJvcGVydGllc1tpXSwga2V5c3RyKSA9PSAwKQotICAgICAgICAgIEZm b250X3B1dCAoZm9udCwga2V5LCB2YWwpOworCUxpc3BfT2JqZWN0IGtleSA9IFhDQVIgKFhDQVIg KGl0KSk7CisJTGlzcF9PYmplY3QgdmFsID0gWENEUiAoWENBUiAoaXQpKTsKKwljaGFyICprZXlz dHIgPSBTU0RBVEEgKFNZTUJPTF9OQU1FIChrZXkpKTsKKwlpZiAoc3RyY21wIChub25fYm9vbGVh bl9wcm9wZXJ0aWVzW2ldLCBrZXlzdHIpID09IDApCisJICBGZm9udF9wdXQgKGZvbnQsIGtleSwg dmFsKTsKICAgICAgIH0KIH0KIApAQCAtMzk4NSw4ICszOTg1LDggQEAgY29weV9mb250X3NwZWMg KExpc3BfT2JqZWN0IGZvbnQpCiAgIGZvciAodGFpbCA9IEFSRUYgKGZvbnQsIEZPTlRfRVhUUkFf SU5ERVgpOyBDT05TUCAodGFpbCk7IHRhaWwgPSBYQ0RSICh0YWlsKSkKICAgICBpZiAoIUVRIChY Q0FSIChYQ0FSICh0YWlsKSksIFFDZm9udF9lbnRpdHkpKQogICAgICAgewotICAgICAgICAqcGNk ciA9IEZjb25zIChGY29ucyAoWENBUiAoWENBUiAodGFpbCkpLCBDRFIgKFhDQ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ICAgICBzZWxlY3RvciBOICgxLi4yNTYpIGRlZmluZXMgYSBnbHlwaCwgdGhhdCBnbHlwaCBjb2Rl IGlzIHN0b3JlZCBpbgogICAgICB0aGUgKE4tMSl0aCBlbGVtZW50IG9mIFZBUklBVElPTlMuICAq LwogICBpbnQgKCpnZXRfdmFyaWF0aW9uX2dseXBocykgKHN0cnVjdCBmb250ICpmb250LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBjLCB1bnNpZ25lZCB2YXJpYXRpb25zWzI1 Nl0pOworCQkJICAgICAgIGludCBjLCB1bnNpZ25lZCB2YXJpYXRpb25zWzI1Nl0pOwogCiAgIHZv aWQgKCpmaWx0ZXJfcHJvcGVydGllcykgKExpc3BfT2JqZWN0IGZvbnQsIExpc3BfT2JqZWN0IHBy b3BlcnRpZXMpOwogCkBAIC03NTUsOCArNzU1LDggQEAgc3RydWN0IGZvbnRfZHJpdmVyCiAgICAg IFJldHVybiBub24temVybyBpZiBGT05UX09CSkVDVCBjYW4gYmUgdXNlZCBhcyBhIChjYWNoZWQp IGZvbnQKICAgICAgZm9yIEVOVElUWSBvbiBmcmFtZSBGLiAgKi8KICAgYm9vbCAoKmNhY2hlZF9m b250X29rKSAoc3RydWN0IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBmb250X29iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmpl Y3QgZW50aXR5KTsKKwkJCSAgTGlzcF9PYmplY3QgZm9udF9vYmplY3QsCisJCQkgIExpc3BfT2Jq ZWN0IGVudGl0eSk7CiAKICAgLyogT3B0aW9uYWwKIApAQCAtNzk5LDEyICs3OTksMTIgQEAgZXh0 ZXJuIExpc3BfT2JqZWN0IGZvbnRfYnVpbGRfb2JqZWN0IChpbnQsIExpc3BfT2JqZWN0LCBMaXNw X09iamVjdCwgZG91YmxlKTsKIAogZXh0ZXJuIExpc3BfT2JqZWN0IGZpbmRfZm9udF9lbmNvZGlu ZyAoTGlzcF9PYmplY3QpOwogZXh0ZXJuIGludCBmb250X3JlZ2lzdHJ5X2NoYXJzZXRzIChMaXNw X09iamVjdCwgc3RydWN0IGNoYXJzZXQgKiosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHN0cnVjdCBjaGFyc2V0ICoqKTsKKwkJCQkgICBzdHJ1Y3QgY2hhcnNldCAqKik7CiBl eHRlcm4gaW50IGZvbnRfc3R5bGVfdG9fdmFsdWUgKGVudW0gZm9udF9wcm9wZXJ0eV9pbmRleCBw cm9wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBuYW1lLCBi b29sIG5vZXJyb3IpOworCQkJCUxpc3BfT2JqZWN0IG5hbWUsIGJvb2wgbm9lcnJvcik7CiBleHRl cm4gTGlzcF9PYmplY3QgZm9udF9zdHlsZV9zeW1ib2xpYyAoTGlzcF9PYmplY3QgZm9udCwKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVtIGZvbnRfcHJvcGVydHlf aW5kZXggcHJvcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBib29s IGZvcl9mYWNlKTsKKwkJCQkJZW51bSBmb250X3Byb3BlcnR5X2luZGV4IHByb3AsCisJCQkJCWJv b2wgZm9yX2ZhY2UpOwogCiBleHRlcm4gYm9vbCBmb250X21hdGNoX3AgKExpc3BfT2JqZWN0IHNw ZWMsIExpc3BfT2JqZWN0IGZvbnQpOwogZXh0ZXJuIExpc3BfT2JqZWN0IGZvbnRfbGlzdF9lbnRp dGllcyAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0KTsKQEAgLTgxNSwxNCArODE1LDE0IEBA IGV4dGVybiBMaXNwX09iamVjdCBmb250X2dldF9mcmFtZSAoTGlzcF9PYmplY3QgZm9udF9vYmpl Y3QpOwogZXh0ZXJuIGludCBmb250X2hhc19jaGFyIChzdHJ1Y3QgZ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0IGEvc3JjL2ZyYW1lLmMgYi9zcmMvZnJhbWUuYwppbmRleCA3 MGFlMzA5Li5hOTgwNmMwIDEwMDY0NAotLS0gYS9zcmMvZnJhbWUuYworKysgYi9zcmMvZnJhbWUu YwpAQCAtNDI5LDExICs0MjksMTEgQEAgYWRqdXN0X2ZyYW1lX3NpemUgKHN0cnVjdCBmcmFtZSAq ZiwgaW50IG5ld193aWR0aCwgaW50IG5ld19oZWlnaHQsIGludCBpbmhpYml0LAogICAgICAgIGVx dWFscyA0LiAgKi8KICAgICB7CiAgICAgICBpbmhpYml0X2hvcml6b250YWwgPSAod2luZG93c193 aWR0aCA+PSBtaW5fd2luZG93c193aWR0aAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICYm IChpbmhpYml0ID09IDQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgfHwgZnJhbWVf aW5oaWJpdF9yZXNpemUgKGYsIHRydWUsIHBhcmFtZXRlcikpKTsKKwkJCSAgICAmJiAoaW5oaWJp dCA9PSA0CisJCQkJfHwgZnJhbWVfaW5oaWJpdF9yZXNpemUgKGYsIHRydWUsIHBhcmFtZXRlcikp KTsKICAgICAgIGluaGliaXRfdmVydGljYWwgPSAod2luZG93c19oZWlnaHQgPj0gbWluX3dpbmRv d3NfaGVpZ2h0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICYmIChpbmhpYml0ID09IDQKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHx8IGZyYW1lX2luaGliaXRfcmVzaXplIChmLCBm YWxzZSwgcGFyYW1ldGVyKSkpOworCQkJICAmJiAoaW5oaWJpdCA9PSA0CisJCQkgICAgICB8fCBm cmFtZV9pbmhpYml0X3Jlc2l6ZSAoZiwgZmFsc2UsIHBhcmFtZXRlcikpKTsKICAgICB9CiAgIGVs c2UKICAgICAvKiBPdGhlcndpc2UgaW5oaWJpdCBpZiBJTkhJQklUIGVxdWFscyA1LiAgKi8KQEAg LTc1OSw5ICs3NTksOSBAQCBt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oc3RydWN0IE1vbml0b3JJbmZvICptb25pdG9ycywgaW50IG5fbW9uaXRvcnMpCiAKIExp c3BfT2JqZWN0CiBtYWtlX21vbml0b3JfYXR0cmlidXRlX2xpc3QgKHN0cnVjdCBNb25pdG9ySW5m byAqbW9uaXRvcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBuX21vbml0b3Jz LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgcHJpbWFyeV9tb25pdG9yLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCBtb25pdG9yX2ZyYW1lcywKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqc291cmNlKQorCQkJICAgICBp bnQgbl9tb25pdG9ycywKKwkJCSAgICAgaW50IHByaW1hcnlfbW9uaXRvciwKKwkJCSAgICAgTGlz cF9PYmplY3QgbW9uaXRvcl9mcmFtZXMsCisJCQkgICAgIGNvbnN0IGNoYXIgKnNvdXJjZSkKIHsK ICAgTGlzcF9PYmplY3QgYXR0cmlidXRlc19saXN0ID0gUW5pbDsKICAgTGlzcF9PYmplY3QgcHJp bWFyeV9tb25pdG9yX2F0dHJpYnV0ZXMgPSBRbmlsOwpAQCAtNDg0NSwyMyArNDg0NSwyMyBAQCBt YWtlX21vbml0b3JfYXR0cmlidXRlX2xpc3QgKHN0cnVjdCBNb25pdG9ySW5mbyAqbW9uaXRvcnMs CiAgICAgICBnZW9tZXRyeSA9IGxpc3Q0aSAobWktPmdlb20ueCwgbWktPmdlb20ueSwKIAkJCSBt aS0+Z2VvbS53aWR0aCwgbWktPmdlb20uaGVpZ2h0KTsKICAgICAgIGF0dHJpYnV0ZXMgPSBGY29u cyAoRmNvbnMgKFFzb3VyY2UsIGJ1aWxkX3N0cmluZyAoc291cmNlKSksCi0gICAgICAgICAgICAg ICAgICAgICAgICAgIGF0dHJpYnV0ZXMpOworCQkJICBhdHRyaWJ1dGVzKTsKICAgICAgIGF0dHJp YnV0ZXMgPSBGY29ucyAoRmNvbnMgKFFmcmFtZXMsIEFSRUYgKG1vbml0b3JfZnJhbWVzLCBpKSks CiAJCQkgIGF0dHJpYnV0ZXMpOwogICAgICAgYXR0cmlidXRlcyA9IEZjb25zIChGY29ucyAoUW1t X3NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBsaXN0MmkgKG1pLT5tbV93 aWR0aCwgbWktPm1tX2hlaWdodCkpLAotICAgICAgICAgICAgICAgICAgICAgICAgICBhdHRyaWJ1 dGVzKTsKKwkJCQkgbGlzdDJpIChtaS0+bW1fd2lkdGgsIG1pLT5tbV9oZWlnaHQpKSwKKwkJCSAg YXR0cmlidXRlcyk7CiAgICAgICBhdHRyaWJ1dGVzID0gRmNvbnMgKEZjb25zIChRd29ya2FyZWEs IHdvcmthcmVhKSwgYXR0cmlidXRlcyk7CiAgICAgICBhdHRyaWJ1dGVzID0gRmNvbnMgKEZjb25z IChRZ2VvbWV0cnksIGdlb21ldHJ5KSwgYXR0cmlidXRlcyk7CiAgICAgICBpZiAobWktPm5hbWUp Ci0gICAgICAgIGF0dHJpYnV0ZXMgPSBGY29ucyAoRmNvbnMgKFFuYW1lLCBtYWtlX3N0cmluZyAo bWktPm5hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgc3RybGVuIChtaS0+bmFtZSkpKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICBhdHRyaWJ1dGVzKTsKKwlhdHRyaWJ1dGVzID0gRmNvbnMgKEZjb25zIChRbmFtZSwgbWFrZV9z dHJpbmcgKG1pLT5uYW1lLAorCQkJCQkJICAgICAgIHN0cmxlbiAobWktPm5hbWUpKSksCisJCQkg ICAgYXR0cmlidXRlcyk7CiAKICAgICAgIGlmIChpID09IHByaW1hcnlfbW9uaXRvcikKLSAgICAg ICAgcHJpbWFyeV9tb25pdG9yX2F0dHJpYnV0ZXMgPSBhdHRyaWJ1d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gICAgTGlzcF9PYmplY3QpOworCQkJ CQkJICAgIHN0cnVjdCBrYm9hcmQgKiwKKwkJCQkJCSAgICBMaXNwX09iamVjdCk7CiBleHRlcm4g Ym9vbCBkaXNwbGF5X2F2YWlsYWJsZSAodm9pZCk7CiAjZW5kaWYKIApAQCAtMTQ5NSwxMCArMTQ5 NSwxMCBAQCBzdHJ1Y3QgTW9uaXRvckluZm8gewogCiBleHRlcm4gdm9pZCBmcmVlX21vbml0b3Jz IChzdHJ1Y3QgTW9uaXRvckluZm8gKm1vbml0b3JzLCBpbnQgbl9tb25pdG9ycyk7CiBleHRlcm4g TGlzcF9PYmplY3QgbWFrZV9tb25pdG9yX2F0dHJpYnV0ZV9saXN0IChzdHJ1Y3QgTW9uaXRvcklu Zm8gKm1vbml0b3JzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IG5fbW9uaXRvcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBpbnQgcHJpbWFyeV9tb25pdG9yLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbW9uaXRvcl9mcmFtZXMsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFy ICpzb3VyY2UpOworCQkJCQkJaW50IG5fbW9uaXRvcnMsCisJCQkJCQlpbnQgcHJpbWFyeV9tb25p dG9yLAorCQkJCQkJTGlzcF9PYmplY3QgbW9uaXRvcl9mcmFtZXMsCisJCQkJCQljb25zdCBjaGFy ICpzb3VyY2UpOwogCiAjZW5kaWYgLyogSEFWRV9XSU5ET1dfU1lTVEVNICovCiAKZGlmZiAtLWdp dCBhL3NyYy9mdGNyZm9udC5jIGIvc3JjL2Z0Y3Jmb250LmMKaW5kZXggNjdiNDNiNi4uYjBjOTk2 OSAxMDA2NDQKLS0tIGEvc3JjL2Z0Y3Jmb250LmMKKysrIGIvc3JjL2Z0Y3Jmb250LmMKQEAgLTY3 LDggKzY3LDggQEAgZW51bSBtZXRyaWNzX3N0YXR1cwogCiBzdGF0aWMgaW50CiBmdGNyZm9udF9n bHlwaF9leHRlbnRzIChzdHJ1Y3QgZm9udCAqZm9udCwKLSAgICAgICAgICAgICAgICAgICAgICAg IHVuc2lnbmVkIGdseXBoLAotICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnRfbWV0 cmljcyAqbWV0cmljcykKKwkJCXVuc2lnbmVkIGdseXBoLAorCQkJc3RydWN0IGZvbnRfbWV0cmlj cyAqbWV0cmljcykKIHsKICAgc3RydWN0IGZ0Y3Jmb250X2luZm8gKmZ0Y3Jmb250X2luZm8gPSAo c3RydWN0IGZ0Y3Jmb250X2luZm8gKikgZm9udDsKICAgaW50IHJvdywgY29sOwpAQCAtMTgyLDkg KzE4Miw5IEBAIGZ0Y3Jmb250X2Nsb3NlIChzdHJ1Y3QgZm9udCAqZm9udCkKIAogc3RhdGljIHZv aWQKIGZ0Y3Jmb250X3RleHRfZXh0ZW50cyAoc3RydWN0IGZvbnQgKmZvbnQsCi0gICAgICAgICAg ICAgICAgICAgICAgIHVuc2lnbmVkICpjb2RlLAotICAgICAgICAgICAgICAgICAgICAgICBpbnQg bmdseXBocywKLSAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZvbnRfbWV0cmljcyAqbWV0 cmljcykKKwkJICAgICAgIHVuc2lnbmVkICpjb2RlLAorCQkgICAgICAgaW50IG5nbHlwaHMsCisJ CSAgICAgICBzdHJ1Y3QgZm9udF9tZXRyaWNzICptZXRyaWNzKQogewogICBpbnQgd2lkdGgsIGk7 CiAKQEAgLTIxNiw3ICsyMTYsNyBAQCBmdGNyZm9udF90ZXh0X2V4dGVudHMgKHN0cnVjdCBmb250 ICpmb250LAogCiBzdGF0aWMgaW50CiBmdGNyZm9udF9kcmF3IChzdHJ1Y3QgZ2x5cGhfc3RyaW5n ICpzLAotICAgICAgICAgICAgICAgaW50IGZyb20sIGludCB0bywgaW50IHgsIGludCB5LCBib29s IHdpdGhfYmFja2dyb3VuZCkKKwkgICAgICAgaW50IGZyb20sIGludCB0bywgaW50IHgsIGludCB5 LCBib29sIHdpdGhfYmFja2dyb3VuZCkKIHsKICAgc3RydWN0IGZyYW1lICpmID0gcy0+ZjsKICAg c3RydWN0IGZhY2UgKmZhY2UgPSBzLT5mYWNlOwpkaWZmIC0tZ2l0IGEvc3JjL2Z0Zm9udC5jIGIv c3JjL2Z0Zm9udC5jCmluZGV4IGJjYzEwYzQuLjY3ZGFmODAgMTAwNjQ0Ci0tLSBhL3NyYy9mdGZv bnQuYworKysgYi9zcmMvZnRmb250LmMKQEAgLTc2LDcgKzc2LDcgQEAgZW51bSBmdGZvbnRfY2Fj aGVfZm9yCiAgIH07CiAKIHN0YXRpYyBMaXNwX09iamVjdCBmdGZvbnRfbG9va3VwX2NhY2hlIChM aXNwX09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlbnVt IGZ0Zm9udF9jYWNoZV9mb3IpOworCQkJCQllbnVtIGZ0Zm9udF9jYWNoZV9mb3IpOwogCiAjZGVm aW5lIFNZTUJPTF9GY0NoYXI4KFNZTSkgKEZjQ2hhcjggKikgU0RBVEEgKFNZTUJPTF9OQU1FIChT WU0pKQogCkBAIC0xMDg1LDkgKzEwODUsOSBAQCBmdGZvbnRfbGlzdF9mYW1pbHkgKHN0cnVjdCBm cmFtZSAqZikKIAogTGlzcF9PYmplY3QKIGZ0Zm9udF9vcGVuMiAoc3RydWN0IGZyYW1lICpmLAot ICAgICAgICAgICAgICBMaXNwX09iamVjdCBlbnRpdHksCi0gICAgICAgICAgICAgIGludCBwaXhl bF9zaXplLAotICAgICAgICAgICAgICBMaXNwX09iamVjdCBmb250X29iamVjdCkKKwkgICAgICBM aXNwX09iamVjdCBlbnRpdHksCisJICAgICAgaW50IHBpeGVsX3NpemUsCisJICAgICA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zX3g1MDlfY3J0X3QpKTsKKwkgICAgICAoZ251dGxz X3g1MDlfY3J0X3QsIGdudXRsc194NTA5X2NydF90KSk7CiBERUZfRExMX0ZOICh2b2lkLCBnbnV0 bHNfeDUwOV9jcnRfZGVpbml0LCAoZ251dGxzX3g1MDlfY3J0X3QpKTsKIERFRl9ETExfRk4gKGlu dCwgZ251dGxzX3g1MDlfY3J0X2ltcG9ydCwKIAkgICAgKGdudXRsc194NTA5X2NydF90LCBjb25z dCBnbnV0bHNfZGF0dW1fdCAqLApAQCAtMjYxLDcgKzI2MSw3IEBAIGluaXRfZ251dGxzX2Z1bmN0 aW9ucyAodm9pZCkKICAgewogICAgIExpc3BfT2JqZWN0IG5hbWUgPSBDQVJfU0FGRSAoRmdldCAo UWdudXRscywgUUNsb2FkZWRfZnJvbSkpOwogICAgIEdOVVRMU19MT0cyICgxLCBtYXhfbG9nX2xl dmVsLCAiR251VExTIGxpYnJhcnkgbG9hZGVkOiIsCi0gICAgICAgICAgICAgICAgIFNUUklOR1Ag KG5hbWUpID8gKGNvbnN0IGNoYXIgKikgU0RBVEEgKG5hbWUpIDogInVua25vd24iKTsKKwkJIFNU UklOR1AgKG5hbWUpID8gKGNvbnN0IGNoYXIgKikgU0RBVEEgKG5hbWUpIDogInVua25vd24iKTsK ICAgfQogCiAgIHJldHVybiAxOwpAQCAtNTkwLDE4ICs1OTAsMTggQEAgZW1hY3NfZ251dGxzX2hh bmRsZV9lcnJvciAoZ251dGxzX3Nlc3Npb25fdCBzZXNzaW9uLCBpbnQgZXJyKQogICAgICAgcmV0 ID0gMTsKIAogICAgICAgc3dpdGNoIChlcnIpCi0gICAgICAgIHsKLSAgICAgICAgY2FzZSBHTlVU TFNfRV9BR0FJTjoKLSAgICAgICAgICBHTlVUTFNfTE9HMiAoMywKLSAgICAgICAgICAgICAgICAg ICAgICAgbWF4X2xvZ19sZXZlbCwKLSAgICAgICAgICAgICAgICAgICAgICAgInJldHJ5OiIsCi0g ICAgICAgICAgICAgICAgICAgICAgIHN0cik7Ci0gICAgICAgIGRlZmF1bHQ6Ci0gICAgICAgICAg R05VVExTX0xPRzIgKDEsCi0gICAgICAgICAgICAgICAgICAgICAgIG1heF9sb2dfbGV2ZWwsCi0g ICAgICAgICAgICAgICAgICAgICAgICJub24tZmF0YWwgZXJyb3I6IiwKLSAgICAgICAgICAgICAg ICAgICAgICAgc3RyKTsKLSAgICAgICAgfQorCXsKKwljYXNlIEdOVVRMU19FX0FHQUlOOgorCSAg R05VVExTX0xPRzIgKDMsCisJCSAgICAgICBtYXhfbG9nX2xldmVsLAorCQkgICAgICAgInJldHJ5 OiIsCisJCSAgICAgICBzdHIpOworCWRlZmF1bHQ6CisJICBHTlVUTFNfTE9HMiAoMSwKKwkJICAg ICAgIG1heF9sb2dfbGV2ZWwsCisJCSAgICAgICAibm9uLWZhdGFsIGVycm9yOiIsCisJCSAgICAg ICBzdHIpOworCX0KICAgICB9CiAKICAgaWYgKGVyciA9PSBHTlVUTFNfRV9XQVJOSU5HX0FMRVJU X1JFQ0VJVkVECkBAIC05OTQsNyArOTk0LDcgQEAgREVGVU4gKCJnbnV0bHMtcGVlci1zdGF0dXMt d2FybmluZy1kZXNjcmliZSIsIEZnbnV0bHNfcGVlcl9zdGF0dXNfd2FybmluZ19kZXNjcmkKIAog ICBpZiAoRVEgKHN0YXR1c19zeW1ib2wsIGludGVybiAoIjp1bmtub3duLWNhIikpKQogICAgIHJl dHVybiBidWlsZF9zdHJpbmcgKCJ0aGUgY2VydGlmaWNhdGUgd2FzIHNpZ25lZCBieSBhbiB1bmtu b3duICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAiYW5kIHRoZXJlZm9yZSB1bnRydXN0ZWQg YXV0aG9yaXR5Iik7CisJCQkgImFuZCB0aGVyZWZvcmUgdW50cnVzdGVkIGF1dGhvcml0eSIpOwog CiAgIGlmIChFUSAoc3RhdHVzX3N5bWJvbCwgaW50ZXJuICgiOm5vdC1jYSIpKSkKICAgICByZXR1 cm4gYn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bm90LCBzZWUg PGh0dHA6Ly93d3cuZ251Lm9yZy9saWNlbnNlcy8+LiAgKi8KIAogI2lmICEgR1RLX0NIRUNLX1ZF UlNJT04gKDIsIDE0LCAwKQogI2RlZmluZSBndGtfYWRqdXN0bWVudF9jb25maWd1cmUoYWRqLCB4 dmFsdWUsIHhsb3dlciwgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICB4dXBwZXIsIHhzdGVwX2luY3JlbWVudCwgICAgICAgIFwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIHhwYWdlX2luY3JlbWVudCwgeHBhZ2VzaXplKSAgICAgXAorCQkJCSB4 dXBwZXIsIHhzdGVwX2luY3JlbWVudCwgICAgICAgIFwKKwkJCQkgeHBhZ2VfaW5jcmVtZW50LCB4 cGFnZXNpemUpICAgICBcCiAgIGRvIHsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIFwKICAgICBhZGotPmxvd2VyID0geGxvd2VyOyAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAogICAgIGFkai0+dXBwZXIgPSB4 dXBwZXI7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCkBAIC0xNTEs NyArMTUxLDcgQEAgc3RhdGljIEd0a1dpZGdldCAqIHhnX2dldF93aWRnZXRfZnJvbV9tYXAgKHB0 cmRpZmZfdCBpZHgpOwogCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAg ICBEaXNwbGF5IGhhbmRsaW5nIGZ1bmN0aW9ucworCQkgICAgICBEaXNwbGF5IGhhbmRsaW5nIGZ1 bmN0aW9ucwogICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioq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mYXVsdF9kaXNwbGF5 IChnZGtfZGlzcGxheV9tYW5hZ2VyX2dldCAoKSwKIAkJCQkJCSAgICAgZ2RweV9uZXcpOwotICAg ICAgICAgICAgYnJlYWs7Ci0gICAgICAgICAgfQorCSAgICBicmVhazsKKwkgIH0KICAgICAgIGdk cHlfZGVmID0gZ2RweV9uZXc7CiAgICAgfQogCkBAIC0yNDUsNyArMjQ1LDcgQEAgeGdfZGlzcGxh eV9jbG9zZSAoRGlzcGxheSAqZHB5KQogCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLSAgICAgICAgICAg ICAgICAgICAgICBVdGlsaXR5IGZ1bmN0aW9ucworCQkgICAgICBVdGlsaXR5IGZ1bmN0aW9ucwog ICoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqLwogCiAvKiBDcmVhdGUgYW5kIHJldHVybiB0aGUgY3Vyc29yIHRvIGJl IHVzZWQgZm9yIHBvcHVwIG1lbnVzIGFuZApAQCAtMjYyLDggKzI2Miw4IEBAIHhnX2NyZWF0ZV9k ZWZhdWx0X2N1cnNvciAoRGlzcGxheSAqZHB5KQogCiBzdGF0aWMgR2RrUGl4YnVmICoKIHhnX2dl dF9waXhidWZfZnJvbV9waXhfYW5kX21hc2sgKHN0cnVjdCBmcmFtZSAqZiwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFBpeG1hcCBwaXgsCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBQaXhtYXAgbWFzaykKKwkJCQkgUGl4bWFwIHBpeCwKKwkJCQkgUGl4bWFwIG1h c2spCiB7CiAgIEdka1BpeGJ1ZiAqaWNvbl9idWYgPSAwOwogICBpbnQgaXVudXNlZDsKQEAgLTI3 Myw3ICsyNzMsNyBAQCB4Z19nZXRfcGl4YnVmX2Zyb21fcGl4X2Fu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yMCBAQCBnZXRfdXRmOF9zdHJpbmcgKGNvbnN0IGNoYXIgKnN0cikK ICAgICAgIEdFcnJvciAqZXJyID0gTlVMTDsKIAogICAgICAgd2hpbGUgKCEgKGNwID0gZ19sb2Nh bGVfdG9fdXRmOCAoKGNoYXIgKilwLCAtMSwgJmJ5dGVzX3JlYWQsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmYnl0ZXNfd3JpdHRlbiwgJmVycikpCi0gICAgICAgICAg ICAgJiYgZXJyLT5jb2RlID09IEdfQ09OVkVSVF9FUlJPUl9JTExFR0FMX1NFUVVFTkNFKQotICAg ICAgICB7Ci0gICAgICAgICAgKytucl9iYWQ7Ci0gICAgICAgICAgcCArPSBieXRlc193cml0dGVu KzE7Ci0gICAgICAgICAgZ19lcnJvcl9mcmVlIChlcnIpOwotICAgICAgICAgIGVyciA9IE5VTEw7 Ci0gICAgICAgIH0KKwkJCQkgICAgICAgJmJ5dGVzX3dyaXR0ZW4sICZlcnIpKQorCSAgICAgJiYg ZXJyLT5jb2RlID09IEdfQ09OVkVSVF9FUlJPUl9JTExFR0FMX1NFUVVFTkNFKQorCXsKKwkgICsr bnJfYmFkOworCSAgcCArPSBieXRlc193cml0dGVuKzE7CisJICBnX2Vycm9yX2ZyZWUgKGVycik7 CisJICBlcnIgPSBOVUxMOworCX0KIAogICAgICAgaWYgKGVycikKLSAgICAgICAgewotICAgICAg ICAgIGdfZXJyb3JfZnJlZSAoZXJyKTsKLSAgICAgICAgICBlcnIgPSBOVUxMOwotICAgICAgICB9 CisJeworCSAgZ19lcnJvcl9mcmVlIChlcnIpOworCSAgZXJyID0gTlVMTDsKKwl9CiAgICAgICBp ZiAoY3ApIGdfZnJlZSAoY3ApOwogCiAgICAgICBsZW4gPSBzdHJsZW4gKHN0cik7CkBAIC01MDAs MjcgKzUwMCwyNyBAQCBnZXRfdXRmOF9zdHJpbmcgKGNvbnN0IGNoYXIgKnN0cikKICAgICAgIHAg PSAodW5z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orCXsKKwkgIHN0cmNweSAodXAs IGNwKTsKKwkgIGdfZnJlZSAoY3ApOworCX0KICAgICAgIGlmIChlcnIpCi0gICAgICAgIHsKLSAg ICAgICAgICBnX2Vycm9yX2ZyZWUgKGVycik7Ci0gICAgICAgICAgZXJyID0gTlVMTDsKLSAgICAg ICAgfQorCXsKKwkgIGdfZXJyb3JfZnJlZSAoZXJyKTsKKwkgIGVyciA9IE5VTEw7CisJfQogICAg IH0KICAgcmV0dXJuIHV0Zjhfc3RyOwogfQpAQCAtNTMxLDggKzUzMSw4IEBAIGdldF91dGY4X3N0 cmluZyAoY29uc3QgY2hhciAqc3RyKQogCiBib29sCiB4Z19jaGVja19zcGVjaWFsX2NvbG9ycyAo c3RydWN0IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmNv bG9yX25hbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgWENvbG9yICpjb2xvcikKKwkJCSBj b25zdCBjaGFyICpjb2xvcl9uYW1lLAorCQkJIFhDb2xvciAqY29sb3IpCiB7CiAgIGJvb2wgc3Vj Y2Vzc19wID0gMDsKICAgYm9vbCBnZXRfYmcgPSBzdHJjbXAgKCJndGtfc2VsZWN0aW9uX2JnX2Nv bG9yIiwgY29sb3JfbmFtZSkgPT0gMDsKQEAgLTU1NSw5ICs1NTUsOSBAQCB4Z19jaGVja19zcGVj aWFsX2NvbG9ycyAoc3RydWN0IGZyYW1lICpmLAogICAgICAgZ3RrX3N0eWxlX2NvbnRleHRfZ2V0 X2JhY2tncm91bmRfY29sb3IgKGdzdHksIHN0YXRlLCAmY29sKTsKIAogICAgIHNwcmludGYgKGJ1 ZiwgInJnYjolMDR4LyUwNHgvJTA0eCIsCi0gICAgICAgICAgICAgKHVuc2lnbmVkKSAoY29sLnJl ZCAqIDY1NTM1KSwKLSAgICAgICAgICAgICAodW5zaWduZWQpIChjb2wuZ3JlZW4gKiA2NTUzNSks Ci0gICAgICAgICAgICAgKHVuc2lnbmVkKSAoY29sLmJsdWUgKiA2NTUzNSkpOworCSAgICAgKHVu c2lnbmVkKSAoY29sLnJlZCAqIDY1NTM1KSwKKwkgICAgICh1bnNpZ25lZCkgKGNvbC5ncmVlbiAq IDY1NTM1KSwKKwkgICAgICh1bnNpZ25lZCkgKGNvbC5ibHVlICogNjU1MzUpKTsKICAgICBzdWNj ZXNzX3AgPSB4X3BhcnNlX2NvbG9yIChmLCBidWYsIGNvbG9yKSAhPSAwOwogI2Vsc2UKICAgICBH dGtTdHlsZSAqZ3N0eSA9IGd0a193aWRnZXRfZ2V0X3N0eWxlIChGUkFNRV9HVEtfV0lER0VUIChm KSk7CkBAIC01ODAsNyArNTgwLDcgQEAgeGdfY2hlY2tfc3BlY2lhbF9jb2xvcnMgKHN0cnVjdCBm cmFtZSAqZiwKIAogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBUb29sdGlwcworCQkJICAgICAgVG9vbHRpcHMKICAqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIC8qIEd0 aysgY2FsbHMgdGhpcyBjYWxsYmFjayB3aGVuIHRoZSBwYXJlbnQgb2Ygb3VyIHRvb2x0aXAgZHVt bXkgY2hhbmdlcy4KICAgIFdlIHVzZSB0aGF0IHRvIHBvcCBkb3duIHRoZSB0b29sdGlwLiAgVGhp cyBoYXBwZW5zIGlmIEd0aysgZm9yIHNvbWUKQEAgLTU5MCw4ICs1OTAsOCBAQCB4Z19jaGVja19z cGVjaWFsX2NvbG9ycyAoc3RydWN0IGZyYW1lICpmLAogCiBzdGF0aWMgdm9pZAogaGllcmFyY2h5 X2NoX2NiIChHdGtXaWRnZXQgKndpZGdldCwKLSAgICAgICAgICAgICAgICAgR3RrV2lkZ2V0ICpw cmV2aW91c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gICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IHN0cmluZywKLSAgICAgICAgICAgICAgICAgICAgaW50 ICp3aWR0aCwKLSAgICAgICAgICAgICAgICAgICAgaW50ICpoZWlnaHQpCisJCSAgICBMaXNwX09i amVjdCBzdHJpbmcsCisJCSAgICBpbnQgKndpZHRoLAorCQkgICAgaW50ICpoZWlnaHQpCiB7CiAj aWZuZGVmIFVTRV9HVEtfVE9PTFRJUAogICByZXR1cm4gMDsKQEAgLTY5MCwxMyArNjkwLDEzIEBA IHhnX3ByZXBhcmVfdG9vbHRpcCAoc3RydWN0IGZyYW1lICpmLAogICAgICAgZ19vYmplY3Rfc2V0 IChzZXR0aW5ncywgImd0ay1lbmFibGUtdG9vbHRpcHMiLCBGQUxTRSwgTlVMTCk7CiAgICAgICAv KiBSZWNvcmQgdGhhdCB3ZSBkaXNhYmxlZCBpdCBzbyBpdCBjYW4gYmUgZW5hYmxlZCBhZ2Fpbi4g ICovCiAgICAgICBnX29iamVjdF9zZXRfZGF0YSAoR19PQkpFQ1QgKHgtPnR0aXBfd2luZG93KSwg InJlc3RvcmUtdHQiLAotICAgICAgICAgICAgICAgICAgICAgICAgIChncG9pbnRlcilmKTsKKwkJ CSAoZ3BvaW50ZXIpZik7CiAgICAgfQogCiAgIC8qIFByZXZlbnQgR3RrKyBmcm9tIGhpZGluZyB0 b29sdGlwIG9uIG1vdXNlIG1vdmUgYW5kIHN1Y2guICAqLwogICBnX29iamVjdF9zZXRfZGF0YSAo R19PQkpFQ1QKLSAgICAgICAgICAgICAgICAgICAgIChndGtfd2lkZ2V0X2dldF9kaXNwbGF5IChH VEtfV0lER0VUICh4LT50dGlwX3dpbmRvdykpKSwKLSAgICAgICAgICAgICAgICAgICAgICJnZGst ZGlzcGxheS1jdXJyZW50LXRvb2x0aXAiLCBOVUxMKTsKKwkJICAgICAoZ3RrX3dpZGdldF9nZXRf ZGlzcGxheSAoR1RLX1dJREdFVCAoeC0+dHRpcF93aW5kb3cpKS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3MsICJndGstZW5hYmxlLXRvb2x0aXBzIiwgVFJVRSwgTlVMTCk7CisJfQogICAgICAg dW5ibG9ja19pbnB1dCAoKTsKIAogICAgICAgcmV0ID0gMTsKQEAgLTc5MSwyMyArNzkxLDIzIEBA IHhnX3NldF9nZW9tZXRyeSAoc3RydWN0IGZyYW1lICpmKQogICAgICAgZ3VpbnQgaWQ7CiAKICAg ICAgIGlmICh4bmVnKQotICAgICAgICBsZWZ0ID0gLWxlZnQ7CisJbGVmdCA9IC1sZWZ0OwogICAg ICAgaWYgKHluZWcpCi0gICAgICAgIHRvcCA9IC10b3A7CisJdG9wID0gLXRvcDsKIAogICAgICAg c3ByaW50ZiAoZ2VvbV9zdHIsICI9JWR4JWQlYyVkJWMlZCIsCi0gICAgICAgICAgICAgICBGUkFN RV9QSVhFTF9XSURUSCAoZiksCi0gICAgICAgICAgICAgICBGUkFNRV9QSVhFTF9IRUlHSFQgKGYp LAotICAgICAgICAgICAgICAgKHhuZWcgPyAnLScgOiAnKycpLCBsZWZ0LAotICAgICAgICAgICAg ICAgKHluZWcgPyAnLScgOiAnKycpLCB0b3ApOworCSAgICAgICBGUkFNRV9QSVhFTF9XSURUSCAo ZiksCisJICAgICAgIEZSQU1FX1BJWEVMX0hFSUdIVCAoZiksCisJICAgICAgICh4bmVnID8gJy0n IDogJysnKSwgbGVmdCwKKwkgICAgICAgKHluZWcgPyAnLScgOiAnKycpLCB0b3ApOwogCiAgICAg ICAvKiBTaWxlbmNlIHdhcm5pbmcgYWJvdXQgdmlzaWJsZSBjaGlsZHJlbi4gICovCiAgICAgICBp ZCA9IGdfbG9nX3NldF9oYW5kbGVyICgiR3RrIiwgR19MT0dfTEVWRUxfV0FSTklORyB8IEdfTE9H X0ZMQUdfRkFUQUwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHwgR19MT0dfRkxBR19S RUNVUlNJT04sIG15X2xvZ19oYW5kbGVyLCBOVUxMKTsKKwkJCSAgICAgIHwgR19MT0dfRkxB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LX09VVEVSX1dJ REdFVCAoZikpKTsKIAogICBndGtfd2lkZ2V0X2FkZF9ldmVudHMgKHdmaXhlZCwKLSAgICAgICAg ICAgICAgICAgICAgICAgICBHREtfUE9JTlRFUl9NT1RJT05fTUFTSwotICAgICAgICAgICAgICAg ICAgICAgICAgIHwgR0RLX0VYUE9TVVJFX01BU0sKLSAgICAgICAgICAgICAgICAgICAgICAgICB8 IEdES19CVVRUT05fUFJFU1NfTUFTSwotICAgICAgICAgICAgICAgICAgICAgICAgIHwgR0RLX0JV VFRPTl9SRUxFQVNFX01BU0sKLSAgICAgICAgICAgICAgICAgICAgICAgICB8IEdES19LRVlfUFJF U1NfTUFTSwotICAgICAgICAgICAgICAgICAgICAgICAgIHwgR0RLX0VOVEVSX05PVElGWV9NQVNL Ci0gICAgICAgICAgICAgICAgICAgICAgICAgfCBHREtfTEVBVkVfTk9USUZZX01BU0sKLSAgICAg ICAgICAgICAgICAgICAgICAgICB8IEdES19GT0NVU19DSEFOR0VfTUFTSwotICAgICAgICAgICAg ICAgICAgICAgICAgIHwgR0RLX1NUUlVDVFVSRV9NQVNLCi0gICAgICAgICAgICAgICAgICAgICAg ICAgfCBHREtfVklTSUJJTElUWV9OT1RJRllfTUFTSyk7CisJCQkgR0RLX1BPSU5URVJfTU9USU9O X01BU0sKKwkJCSB8IEdES19FWFBPU1VSRV9NQVNLCisJCQkgfCBHREtfQlVUVE9OX1BSRVNTX01B U0sKKwkJCSB8IEdES19CVVRUT05fUkVMRUFTRV9NQVNLCisJCQkgfCBHREtfS0VZX1BSRVNTX01B U0sKKwkJCSB8IEdES19FTlRFUl9OT1RJRllfTUFTSworCQkJIHwgR0RLX0xFQVZFX05PVElGWV9N QVNLCisJCQkgfCBHREtfRk9DVVNfQ0hBTkdFX01BU0sKKwkJCSB8IEdES19TVFJVQ1RVUkVfTUFT SworCQkJIHwgR0RLX1ZJU0lCSUxJVFlfTk9USUZZX01BU0spOwogCiAgIC8qIE11c3QgcmVhbGl6 ZSB0aGUgd2luZG93cyBzbyB0aGUgWCB3aW5kb3cgZ2V0cyBjcmVhdGVkLiAgSXQgaXMgdXNlZAog ICAgICBieSBjYWxsZXJzIG9mIHRoaXMgZnVuY3Rpb24uICAqLwpAQCAtMTI2NywxNCArMTI2Nywx NCBAQCB4Z19jcmVhdGVfZnJhbWVfd2lkZ2V0cyAoc3RydWN0IGZyYW1lICpmKQogICAgIEd0a1Nl dHRpbmdzICpncyA9IGd0a19zZXR0aW5nc19nZXRfZm9yX3NjcmVlbiAoc2NyZWVuKTsKICAgICAv KiBPbmx5IGNvbm5lY3QgdGhpcyBzaWduYWwgb25jZSBwZXIgc2NyZWVuLiAgKi8KICAgICBpZiAo ISBnX3NpZ25hbF9oYW5kbGVyX2ZpbmQgKEdfT0JKRUNUIChncyksCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBHX1NJR05BTF9NQVRDSF9GVU5DLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgMCwgMCwgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChncG9pbnRlcikgR19DQUxMQkFDSyAoc3R5bGVfY2hhbmdlZF9jYiksCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAwKSkKKwkJCQkgR19TSUdOQUxfTUFUQ0hfRlVOQywKKwkJCQkg MCwgMCwgMCwKKwkJCQkgKGdwb2ludGVyKSBHX0NBTExCQUNLIChzdHlsZV9jaGFuZ2VkX2NiKSwK KwkJCQkgMCkpCiAgICAgICB7Ci0gICAgICAgIGdfc2lnbmFsX2Nvbm5lY3QgKEdfT0JKRUNUIChn cyksICJub3RpZnk6Omd0ay10aGVtZS1uYW1lIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg R19DQUxMQkFDSyAoc3R5bGVfY2hhbmdlZF9jYiksCi0gICAgICAgICAgICAgICAgICAgICAgICAg IGdka19zY3JlZW5fZ2V0X2Rpc3BsYXkgKHNjcmVlbikpOworCWdfc2lnbmFsX2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FUl9XSURHRVQgKGYpKSwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAmc2l6ZV9oaW50cywgaGludF9mbGFn cyk7CisJCQkJICAgICBOVUxMLCAmc2l6ZV9oaW50cywgaGludF9mbGFncyk7CiAgICAgICBmLT5v dXRwdXRfZGF0YS54LT5zaXplX2hpbnRzID0gc2l6ZV9oaW50czsKICAgICAgIGYtPm91dHB1dF9k YXRhLngtPmhpbnRfZmxhZ3MgPSBoaW50X2ZsYWdzOwogICAgICAgdW5ibG9ja19pbnB1dCAoKTsK QEAgLTE0NDcsMTQgKzE0NDcsMTQgQEAgeGdfc2V0X2JhY2tncm91bmRfY29sb3IgKHN0cnVjdCBm cmFtZSAqZiwgdW5zaWduZWQgbG9uZyBiZykKIAogICAgICAgTGlzcF9PYmplY3QgYmFyOwogICAg ICAgZm9yIChiYXIgPSBGUkFNRV9TQ1JPTExfQkFSUyAoZik7Ci0gICAgICAgICAgICFOSUxQIChi YXIpOwotICAgICAgICAgICBiYXIgPSBYU0NST0xMX0JBUiAoYmFyKS0+bmV4dCkKLSAgICAgICAg ewotICAgICAgICAgIEd0a1dpZGdldCAqc2Nyb2xsYmFyID0KLSAgICAgICAgICAgIHhnX2dldF93 aWRnZXRfZnJvbV9tYXAgKFhTQ1JPTExfQkFSIChiYXIpLT54X3dpbmRvdyk7Ci0gICAgICAgICAg R3RrV2lkZ2V0ICp3ZWJveCA9IGd0a193aWRnZXRfZ2V0X3BhcmVudCAoc2Nyb2xsYmFyKTsKLSAg ICAgICAgICB4Z19zZXRfd2lkZ2V0X2JnIChmLCB3ZWJveCwgRlJBTUVfQkFDS0dST1VORF9QSVhF TCAoZikpOwotICAgICAgICB9CisJICAgIU5JTFAgKGJhcik7CisJICAgYmFyID0gWFNDUk9MTF9C QVIgKGJhciktPm5leHQpCisJeworCSAgR3RrV2lkZ2V0ICpzY3JvbGxiYXIgPQorCSAgICB4Z19n ZXRfd2lkZ2V0X2Zyb21fbWFwIChYU0NST0xMX0JBUiAoYmFyKS0+eF93aW5kb3cpOworCSAgR3Rr V2lkZ2V0ICp3ZWJveCA9IGd0a193aWRnZXRfZ2V0X3BhcmVudCAoc2Nyb2xsYmFyKTsKKwkgIHhn X3NldF93aWRnZXRfYmcgKGYsIHdlYm94LCBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisJ fQogCiAgICAgICB1bmJsb2NrX2lucHV0ICgpOwogICAgIH0KQEAgLTE0NjgsOCArMTQ2OCw4IEBA IHZvaWQKIHhnX3NldF9mcmFtZV9pY29uIChzdHJ1Y3QgZnJhbWUgKmYsIFBpeG1hcCBpY29uX3Bp eG1hcCwgUGl4bWFwIGljb25fbWFzaykKIHsKICAgR2RrUGl4YnVmICpncCA9IHhnX2dldF9waXhi dWZfZnJvbV9waXhfYW5kX21hc2sgKGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpY29uX3BpeG1hcCwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGljb25fbWFzayk7CisJCQkJCQkgICBpY29uX3Bp eG1hcCwKKwkJCQkJCSAgIGljb25fbWFzayk7CiAgIGlmIChncCkKICAgICBndGtfd2luZG93X3Nl dF9pY29uIChHVEtfV0lORE9XIChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSksIGdwKTsKIH0K QEAgLTE0NzcsNyArMTQ3Nyw3IEBAIHhnX3NldF9mcmFtZV9pY29uIChzdHJ1Y3QgZnJhbWUgKmYs IFBpeG1hcCBpY29uX3BpeG1hcCwgUGl4bWFwIGljb25fbWFzaykKIAogDAogLyoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCi0gICAgICAgICAgICAgICAgICAgICAgRGlhbG9nIGZ1bmN0aW9ucworCQkgICAgICBEaWFs b2cgZnVuY3Rpb25zCiAgKio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G8gYWRkIHRvIHRoZSBkaWFs b2cuICAqLwotICAgICAgICAgIHcgPSBndGtfYnV0dG9uX25ld193aXRoX2xhYmVsICh1dGY4X2xh YmVsKTsKLSAgICAgICAgICBpZiAoISBpdGVtLT5lbmFibGVkKQotICAgICAgICAgICAgZ3RrX3dp ZGdldF9zZXRfc2Vuc2l0aXZlICh3LCBGQUxTRSk7Ci0gICAgICAgICAgaWYgKHNlbGVjdF9jYikK LSAgICAgICAgICAgIGdfc2lnbmFsX2Nvbm5lY3QgKEdfT0JKRUNUICh3KSwgImNsaWNrZWQiLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0X2NiLCBpdGVtLT5jYWxsX2RhdGEp OwotCi0gICAgICAgICAgZ3RrX2JveF9wYWNrX3N0YXJ0IChjdXJfYm94LCB3LCBUUlVFLCBUUlVF LCBidXR0b25fc3BhY2luZyk7Ci0gICAgICAgICAgaWYgKCsrYnV0dG9uX25yID09IGxlZnRfYnV0 dG9ucykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaWYgKG1ha2VfdHdvX3Jvd3MpCi0g ICAgICAgICAgICAgICAgY3VyX2JveCA9IEdUS19CT1ggKHdoYm94X2Rvd24pOwotICAgICAgICAg ICAgfQotICAgICAgICB9CisJeworCSAgLyogVGhpcyBpcyBvbmUgYnV0dG9uIHRvIGFkZCB0byB0 aGUgZGlhbG9nLiAgKi8KKwkgIHcgPSBndGtfYnV0dG9uX25ld193aXRoX2xhYmVsICh1dGY4X2xh YmVsKTsKKwkgIGlmICghIGl0ZW0tPmVuYWJsZWQpCisJICAgIGd0a193aWRnZXRfc2V0X3NlbnNp dGl2ZSAodywgRkFMU0UpOworCSAgaWYgKHNlbGVjdF9jYikKKwkgICAgZ19zaWduYWxfY29ubmVj dCAoR19PQkpFQ1QgKHcpLCAiY2xpY2tlZCIsCisJCQkgICAgICBzZWxlY3RfY2IsIGl0ZW0tPmNh bGxfZGF0YSk7CisKKwkgIGd0a19ib3hfcGFja19zdGFydCAoY3VyX2JveCwgdywgVFJVRSwgVFJV RSwgYnV0dG9uX3NwYWNpbmcpOworCSAgaWYgKCsrYnV0dG9uX25yID09IGxlZnRfYnV0dG9ucykK KwkgICAgeworCSAgICAgIGlmIChtYWtlX3R3b19yb3dzKQorCQljdXJfYm94ID0gR1RLX0JPWCAo d2hib3hfZG93bik7CisJICAgIH0KKwl9CiAKICAgICAgaWYgKHV0ZjhfbGFiZWwpCiAgICAgICAg Z19mcmVlICh1dGY4X2xhYmVsKTsKQEAgLTE3MjgsNyArMTcyOCw3IEBAIHhnX2RpYWxvZ19ydW4g KHN0cnVjdCBmcmFtZSAqZiwgR3RrV2lkZ2V0ICp3KQogCiAgIHhnX3NldF9zY3JlZW4gKHcsIGYp OwogICBndGtfd2luZG93X3NldF90cmFuc2llbnRfZm9yIChHVEtfV0lORE9XICh3KSwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgR1RLX1dJTkRPVyAoRlJBTUVfR1RLX09VVEVSX1dJ REdFVCAoZikpKTsKKwkJCQlHVEtfV0lORE9XIChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSkp OwogICBndGtfd2luZG93X3NldF9kZXN0cm95X3dpdGhfcGFyZW50IChHVEtfV0lORE9XICh3KSwg VFJVRSk7CiAgIGd0a193aW5kb3dfc2V0X21vZGFsIChHVEtfV0lORE9XICh3KSwgVFJVRSk7CiAK QEAgLTE3MzgsOSArMTczOCw5IEBAIHhnX2RpYWxvZ19ydW4gKHN0cnVjdCBmcmFtZSAqZiwgR3Rr V2lkZ2V0ICp3KQogICBkZC50aW1lcmlkID0gMDsKIAogICBnX3NpZ25hbF9jb25uZWN0IChHX09C SkVDVCAodyksCi0gICAgICAgICAgICAgICAgICAgICJyZXNwb25zZSIsCi0gICAgICAgICAgICAg ICAgICAgIEdfQ0FMTEJBQ0sgKHhnX2RpYWxvZ19yZXNwb25zZV9jYiksCi0gICAgICAgICAgICAg ICAgICAgICZkZCk7CisJCS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ogICBHdGtXaW5kb3cgKmd3 aW4gPSBHVEtfV0lORE9XIChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSk7CiAgIEd0a0ZpbGVD aG9vc2VyQWN0aW9uIGFjdGlvbiA9IChtdXN0bWF0Y2hfcCA/Ci0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBHVEtfRklMRV9DSE9PU0VSX0FDVElPTl9PUEVOIDoKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIEdUS19GSUxFX0NIT09TRVJfQUNUSU9OX1NBVkUpOworCQkJ CSBHVEtfRklMRV9DSE9PU0VSX0FDVElPTl9PUEVOIDoKKwkJCQkgR1RLX0ZJTEVfQ0hPT1NFUl9B Q1RJT05fU0FWRSk7CiAKICAgaWYgKG9ubHlfZGlyX3ApCiAgICAgYWN0aW9uID0gR1RLX0ZJTEVf Q0hPT1NFUl9BQ1RJT05fU0VMRUNUX0ZPTERFUjsKIAogICBmaWxld2luID0gZ3RrX2ZpbGVfY2hv b3Nlcl9kaWFsb2dfbmV3IChwcm9tcHQsIGd3aW4sIGFjdGlvbiwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgWEdfVEVYVF9DQU5DRUwsIEdUS19SRVNQT05TRV9DQU5D RUwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChtdXN0bWF0Y2hf cCB8fCBvbmx5X2Rpcl9wID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIFhHX1RFWFRfT1BFTiA6IFhHX1RFWFRfT0spLAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBHVEtfUkVTUE9OU0VfT0ssCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIE5VTEwpOworCQkJCQkgWEdfVEVYVF9DQU5DRUwsIEdUS19SRVNQ T05TRV9DQU5DRUwsCisJCQkJCSAobXVzdG1hdGNoX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N0cmluZyAoZGVmYXVs dF9maWxlbmFtZSk7CiAKICAgICAgIC8qIEZpbGUgY2hvb3NlciBkb2VzIG5vdCB1bmRlcnN0YW5k IH4vLi4uIGluIHRoZSBmaWxlIG5hbWUuICBJdCBtdXN0IGJlCi0gICAgICAgICBhbiBhYnNvbHV0 ZSBuYW1lIHN0YXJ0aW5nIHdpdGggLy4gICovCisJIGFuIGFic29sdXRlIG5hbWUgc3RhcnRpbmcg d2l0aCAvLiAgKi8KICAgICAgIGlmIChkZWZhdWx0X2ZpbGVuYW1lWzBdICE9ICcvJykKLSAgICAg ICAgZmlsZSA9IEZleHBhbmRfZmlsZV9uYW1lIChmaWxlLCBRbmlsKTsKKwlmaWxlID0gRmV4cGFu ZF9maWxlX25hbWUgKGZpbGUsIFFuaWwpOwogCiAgICAgICB1dGY4X2ZpbGVuYW1lID0gU1NEQVRB IChFTkNPREVfVVRGXzggKGZpbGUpKTsKICAgICAgIGlmICghIE5JTFAgKEZmaWxlX2RpcmVjdG9y eV9wIChmaWxlKSkpCi0gICAgICAgIGd0a19maWxlX2Nob29zZXJfc2V0X2N1cnJlbnRfZm9sZGVy IChHVEtfRklMRV9DSE9PU0VSIChmaWxld2luKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIHV0ZjhfZmlsZW5hbWUpOworCWd0a19maWxlX2Nob29zZXJfc2V0 X2N1cnJlbnRfZm9sZGVyIChHVEtfRklMRV9DSE9PU0VSIChmaWxld2luKSwKKwkJCQkJICAgICB1 dGY4X2ZpbGVuYW1lKTsKICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAgICAgIGd0a19maWxl X2Nob29zZXJfc2V0X2ZpbGVuYW1lIChHVEtfRklMRV9DSE9PU0VSIChmaWxld2luKSwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXRmOF9maWxlbmFtZSk7Ci0gICAg ICAgICAgaWYgKGFjdGlvbiA9PSBHVEtfRklMR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ioqKioq KioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgR1RLIGZvbnQgY2hvb3NlcgorCQkg ICAgICBHVEsgZm9udCBjaG9vc2VyCiAgKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAKICNpZmRlZiBIQVZFX0ZS RUVUWVBFCkBAIC0yMDg2LDEyICsyMDg2LDEyIEBAIHhnX2dldF9mb250IChzdHJ1Y3QgZnJhbWUg KmYsIGNvbnN0IGNoYXIgKmRlZmF1bHRfbmFtZSkKIAkgbnVtYmVyICovCiAgICAgICBjaGFyICpw ID0gc3RycmNociAoZGVmYXVsdF9uYW1lLCAnLScpOwogICAgICAgaWYgKHApCi0gICAgICAgIHsK LSAgICAgICAgICBjaGFyICplcCA9IHArMTsKLSAgICAgICAgICB3aGlsZSAoY19pc2RpZ2l0ICgq ZXApKQotICAgICAgICAgICAgKytlcDsKLSAgICAgICAgICBpZiAoKmVwID09ICdcMCcpICpwID0g JyAnOwotICAgICAgICB9CisJeworCSAgY2hhciAqZXAgPSBwKzE7CisJICB3aGlsZSAoY19pc2Rp Z2l0ICgqZXApKQorCSAgICArK2VwOworCSAgaWYgKCplcCA9PSAnXDAnKSAqcCA9ICcgJzsKKwl9 CiAgICAgfQogICBlbHNlIGlmICh4X2xhc3RfZm9udF9uYW1lKQogICAgIGRlZmF1bHRfbmFtZSA9 IHhfbGFzdF9mb250X25hbWU7CkBAIC0yMTI2LDcgKzIxMjYsNyBAQCB4Z19nZXRfZm9udCAoc3Ry dWN0IGZyYW1lICpmLCBjb25zdCBjaGFyICpkZWZhdWx0X25hbWUpCiAJCQlRQ3dlaWdodCwgWEdf V0VJR0hUX1RPX1NZTUJPTCAod2VpZ2h0KSwKIAkJCVFDc2xhbnQsIFhHX1NUWUxFX1RPX1NZTUJP TCAoc3R5bGUpLAogCQkJUUN0eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgRk9OVF9UWVBF X1dBTlRFRCk7CisJCQlGT05UX1RZUEVfV0FOVEVEKTsKIAogCSAgcGFuZ29fZm9udF9kZXNjcmlw dGlvbl9mcmVlIChkZXNjKTsKIAkgIGR1cHN0cmluZyAoJnhfbGFzdF9mb250X25hbWUsIG5hbWUp OwpAQCAtMjE1NCw3ICsyMTU0LDcgQEAgeGdfZ2V0X2ZvbnQgKHN0cnVjdCBmcmFtZSAqZiwgY29u c3QgY2hhciAqZGVmYXVsdF9uYW1lKQogCiAMCiAvKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioKLQkgICAgICAgICAg ICAgICAgTWVudSBmdW5jdGlvbnMuCisJCQlNZW51IGZ1bmN0aW9ucy4KICAqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq Ki8KIAogLyogVGhlIG5hbWUgb2YgbWVudSBpdGVtcyB0aGF0IGNhbiBiZSB1c2VkIGZvciBjdXN0 b21pemF0aW9uLiAgU2luY2UgR1RLCkBAIC0yMjE1LDggKzIyMTUsOCBAQCBtYWtlX2NsX2RhdGEg KHhnX21lbnVfY2JfZGF0YSAqY2xfZGF0YSwgc3RydWN0IGZyYW1lICpmLCBHQ2FsbGJhY2sgaGln aGxpZ2h0X2NiKQogCiBzdGF0aWMgdm9pZAogdXBkYXRlX2NsX2RhdGEgKHhnX21lbnVfY2JfZGF0 YSAqY2xfZGF0YSwKLSAgICAgICAgICAgICAgICBzdHJ1Y3QgZnJhbWUgKmYsCi0gICAgICAgICAg ICAgICAgR0NhbGxiYWNrIGhpZ2hsaWdodF9jYikKKwkJc3RydWN0IGZyYW1lICpmLAorCQlHQ2Fs bGJhY2sgaGlnaGxpZ2h0X2NiKQogewogICBpZiAoY2xfZGF0YSkKICAgICB7CkBAIC0yMjM3LDEw ICsyMjM3LDEwIEBAIHVucmVmX2NsX2RhdGEgKHhnX21lb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VSX1dJREdF VCAoZikpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgVEJfSU5GT19LRVkpOwot ICAgICAgICAgIGlmICh0YmluZm8pCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIG1hcmtf b2JqZWN0ICh0YmluZm8tPmxhc3RfdG9vbF9iYXIpOwotICAgICAgICAgICAgICBtYXJrX29iamVj dCAodGJpbmZvLT5zdHlsZSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJICBzdHJ1 Y3QgeGdfZnJhbWVfdGJfaW5mbyAqdGJpbmZvCisJICAgID0gZ19vYmplY3RfZ2V0X2RhdGEgKEdf T0JKRUNUIChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSksCisJCQkJIFRCX0lORk9fS0VZKTsK KwkgIGlmICh0YmluZm8pCisJICAgIHsKKwkgICAgICBtYXJrX29iamVjdCAodGJpbmZvLT5sYXN0 X3Rvb2xfYmFyKTsKKwkgICAgICBtYXJrX29iamVjdCAodGJpbmZvLT5zdHlsZSk7CisJICAgIH0K Kwl9CiAgICAgfQogfQogCkBAIC0yMzA1LDggKzIzMDUsOCBAQCBtZW51aXRlbV9kZXN0cm95X2Nh bGxiYWNrIChHdGtXaWRnZXQgKncsIGdwb2ludGVyIGNsaWVudF9kYXRhKQogCiBzdGF0aWMgZ2Jv b2xlYW4KIG1lbnVpdGVtX2hpZ2hsaWdodF9jYWxsYmFjayAoR3RrV2lkZ2V0ICp3LAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBHZGtFdmVudENyb3NzaW5nICpldmVudCwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgZ3BvaW50ZXIgY2xpZW50X2RhdGEpCisJCQkgICAgIEdka0V2 ZW50Q3Jvc3NpbmcgKmV2ZW50LAorCQkJICAgICBncG9pbnRlciBjbGllbnRfZGF0YSkKIHsKICAg R2RrRXZlbnQgZXY7CiAgIEd0a1dpZGdldCAqc3Vid2lkZ2V0Owp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BpdGVtLT5jb250ZW50cykK ICAgICB7CiAgICAgICBpZiAoc2VsZWN0X2NiKQotICAgICAgICBjYl9kYXRhLT5zZWxlY3RfaWQK LSAgICAgICAgICA9IGdfc2lnbmFsX2Nvbm5lY3QgKEdfT0JKRUNUICh3KSwgImFjdGl2YXRlIiwg c2VsZWN0X2NiLCBjYl9kYXRhKTsKKwljYl9kYXRhLT5zZWxlY3RfaWQKKwkgID0gZ19zaWduYWxf Y29ubmVjdCAoR19PQkpFQ1QgKHcpLCAiYWN0aXZhdGUiLCBzZWxlY3RfY2IsIGNiX2RhdGEpOwog ICAgIH0KIAogICByZXR1cm4gdzsKQEAgLTI1MTksMTUgKzI1MTksMTUgQEAgeGdfY3JlYXRlX29u ZV9tZW51aXRlbSAod2lkZ2V0X3ZhbHVlICppdGVtLAogCiBzdGF0aWMgR3RrV2lkZ2V0ICoKIGNy ZWF0ZV9tZW51cyAod2lkZ2V0X3ZhbHVlICpkYXRhLAotICAgICAgICAgICAgICBzdHJ1Y3QgZnJh bWUgKmYsCi0gICAgICAgICAgICAgIEdDYWxsYmFjayBzZWxlY3RfY2IsCi0gICAgICAgICAgICAg IEdDYWxsYmFjayBkZWFjdGl2YXRlX2NiLAotICAgICAgICAgICAgICBHQ2FsbGJhY2sgaGlnaGxp Z2h0X2NiLAotICAgICAgICAgICAgICBib29sIHBvcF91cF9wLAotICAgICAgICAgICAgICBib29s IG1lbnVfYmFyX3AsCi0gICAgICAgICAgICAgIEd0a1dpZGdldCAqdG9wbWVudSwKLSAgICAgICAg ICAgICAgeGdfbWVudV9jYl9kYXRhICpjbF9kYXRhLAotICAgICAgICAgICAgICBjb25zdCBjaGFy ICpuYW1lKQorCSAgICAgIHN0cnVjdCBmcmFtZSAqZiwKKwkgICAgICBHQ2FsbGJhY2sgc2VsZWN0 X2NiLAorCSAgICAgIEdDYWxsYmFjayBkZWFjdGl2YXRlX2NiLAorCSAgICAgIEdDYWxsYmFjayBo aWdobGlnaHRfY2IsCisJICAgICAgYm9vbCBwb3BfdXBfcCwKKwkgICAgICBib29sIG1lbnVfYmFy X3AsCisJICAgICAgR3RrV2lkZ2V0ICp0b3BtZW51LAorCSAgICAgIHhnX21lbnVfY2JfZGF0YSAq Y2xfZGF0YSwKKwkgICAgICBjb25zdCBjaGFyICpuYW1lKQogewogICB3aWRnZXRfdmFsdWUgKml0 ZW07CiAgIEd0a1dpZGdldCAqd21lbnUgPSB0b3BtZW51OwpAQCAtMjUzNyw0MiArMjUzNyw0MiBA QCBjcmVhdGVfbWVudXMgKHdpZGdldF92YWx1ZSAqZGF0YSwKICAgICB7CiAgICAgICBpZiAoISBt ZW51X2Jhcl9wKQogICAgICAgewotICAgICAgICB3bWVudSA9IGd0a19tZW51X25ldyAoKTsKLSAg ICAgICAgeGdfc2V0X3NjcmVlbiAod21lbnUsIGYpOwotICAgICAgICAvKiBDb25uZWN0IHRoaXMg dG8gdGhlIG1lbnUgaW5zdGVhZCBvZiBpdGVtcyBzbyB3ZSBnZXQgZW50ZXIvbGVhdmUgZm9yCi0g ICAgICAgICAgIGRpc2FibGVkIGl0ZW1zIGFsc28uICBUT0RPOiAgU3RpbGwgZG9lcyBub3QgZ2V0 IGVudGVyL2xlYXZlIGZvcgotICAgICAgICAgICBkaXNhYmxlZCBpdGVtcyBpbiBkZXRhY2hlZCBt ZW51cy4gICovCi0gICAgICAgIGdfc2lnbmFsX2Nvbm5lY3QgKEdfT0JKRUNUICh3bWVudSksCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICJlbnRlci1ub3RpZnktZXZlbnQiLAotICAgICAgICAg ICAgICAgICAgICAgICAgICBHX0NBTExCQUNLIChtZW51aXRlbV9oaWdobGlnaHRfY2FsbGJhY2sp LAotICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMKTsKLSAgICAgICAgZ19zaWduYWxfY29u bmVjdCAoR19PQkpFQ1QgKHdtZW51KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgImxlYXZl LW5vdGlmeS1ldmVudCIs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JvdXAgPSBO VUxMOworCSAgLyogR1RLIG9ubHkgaGF2ZSBvbmUgc2VwYXJhdG9yIHR5cGUuICAqLworCSAgdyA9 IGd0a19zZXBhcmF0b3JfbWVudV9pdGVtX25ldyAoKTsKKwl9CiAgICAgICBlbHNlCi0gICAgICAg IHsKLSAgICAgICAgICB3ID0geGdfY3JlYXRlX29uZV9tZW51aXRlbSAoaXRlbSwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaXRlbS0+Y29udGVudHMgPyAwIDogc2VsZWN0X2NiLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdobGlnaHRfY2IsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGNsX2RhdGEsCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICZncm91cCk7Ci0KLSAgICAgICAgICAvKiBDcmVhdGUgYSBwb3NzaWJs eSBlbXB0eSBzdWJtZW51IGZvciBtZW51IGJhciBpdGVtcywgc2luY2Ugc29tZQotICAgICAgICAg ICAgIHRoZW1lcyBkb24ndCBoaWdobGlnaHQgaXRlbXMgY29ycmVjdGx5IHdpdGhvdXQgaXQuICov Ci0gICAgICAgICAgaWYgKGl0ZW0tPmNvbnRlbnRzIHx8IG1lbnVfYmFyX3ApCi0gICAgICAgICAg ICB7Ci0gICAgICAgICAgICAgIEd0a1dpZGdldCAqc3VibWVudSA9IGNyZWF0ZV9tZW51cyAoaXRl bS0+Y29udGVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzZWxlY3RfY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgZGVhY3RpdmF0ZV9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBoaWdobGlnaHRfY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgY2xfZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAwKTsKLSAgICAgICAgICAgICAgZ3RrX21lbnVfaXRlbV9zZXRfc3VibWVudSAo R1RLX01FTlVfSVRFTSAodyksIHN1Ym1lbnUpOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJ eworCSAgdyA9IHhnX2NyZWF0ZV9vbmVfbWVudWl0ZW0gKGl0ZW0sCisJCQkJICAgICAgZiwKKwkJ CQkgICAgICBpdGVtLT5jb250ZW50cyA/IDAgOiBzZWxlY3RfY2IsCisJCQkJICAgICAgaGlnaGxp Z2h0X2NiLAorCQkJCSAgICAgIGNsX2RhdGEsCisJCQkJICAgICAgJmdyb3VwKTsKKworCSAgLyog Q3JlYXRlIGEgcG9zc2libHkgZW1wdHkgc3VibWVudSBmb3IgbWVudSBiYXIgaXRlbXMsIHNpbmNl IHNvbWUKKwkgICAgIHRoZW1lcyBkb24ndCBoaWdobGlnaHQgaXRlbXMgY29ycmVjdGx5IHdpdGhv dXQgaXQuICovCisJICBpZiAoaXRlbS0+Y29udGVudHMgfHwgbWVudV9iYXJfcCkKKwkgICAgewor CSAgICAgIEd0a1dpZGdldCAqc3VibWVudSA9IGNyZWF0ZV9tZW51cyAoaXRlbS0+Y29udGVudHMs CisJCQkJCQkgZiwKKwkJCQkJCSBzZWxlY3RfY2IsCisJCQkJCQkgZGVhY3RpdmF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jcmVhdGVfd2lkZ2V0IChjb25zdCBjaGFyICp0eXBlLCBj b25zdCBjaGFyICpuYW1lLCBzdHJ1Y3QgZnJhbWUgKmYsCiAgIGVsc2UgaWYgKG1lbnVfYmFyX3Ag fHwgcG9wX3VwX3ApCiAgICAgewogICAgICAgdyA9IGNyZWF0ZV9tZW51cyAodmFsLT5jb250ZW50 cywKLSAgICAgICAgICAgICAgICAgICAgICAgIGYsCi0gICAgICAgICAgICAgICAgICAgICAgICBz ZWxlY3RfY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICBkZWFjdGl2YXRlX2NiLAotICAgICAg ICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0X2NiLAotICAgICAgICAgICAgICAgICAgICAgICAg cG9wX3VwX3AsCi0gICAgICAgICAgICAgICAgICAgICAgICBtZW51X2Jhcl9wLAotICAgICAgICAg ICAgICAgICAgICAgICAgMCwKLSAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAg ICAgICAgICAgICAgICBuYW1lKTsKKwkJCWYsCisJCQlzZWxlY3RfY2IsCisJCQlkZWFjdGl2YXRl X2NiLAorCQkJaGlnaGxpZ2h0X2NiLAorCQkJcG9wX3VwX3AsCisJCQltZW51X2Jhcl9wLAorCQkJ MCwKKwkJCTAsCisJCQluYW1lKTsKIAogICAgICAgLyogU2V0IHRoZSBjdXJzb3IgdG8gYW4gYXJy b3cgZm9yIHBvcHVwIG1lbnVzIHdoZW4gdGhleSBhcmUgbWFwcGVkLgotICAgICAgICAgVGhpcyBp cyBkb25lIGJ5IGRlZmF1bHQgZm9yIG1lbnUgYmFyIG1lbnVzLiAgKi8KKwkgVGhpcyBpcyBkb25l IGJ5IGRlZmF1bHQgZm9yIG1lbnUgYmFyIG1lbnVzLiAgKi8KICAgICAgIGlmIChwb3BfdXBfcCkK LSAgICAgICAgewotICAgICAgICAgIC8qIE11c3QgcmVhbGl6ZSBzbyB0aGUgR2RrV2luZG93IGlu c2lkZSB0aGUgd2lkZ2V0IGlzIGNyZWF0ZWQuICAqLwotICAgICAgICAgIGd0a193aWRnZXRfcmVh bGl6ZSAodyk7Ci0gICAgICAgICAgeGdfc2V0X2N1cnNvciAodywgRlJBTUVfRElTUExBWV9JTkZP IChmKS0+eGdfY3Vyc29yKTsKLSAgICAgICAgfQorCXsKKwkgIC8qIE11c3QgcmVhbGl6ZSBzbyB0 aGUgR2RrV2luZG93IGluc2lkZSB0aGUgd2lkZ2V0IGlzIGNyZWF0ZWQuICAqLworCSAgZ3RrX3dp ZGdldF9yZWFsaXplICh3KTsKKwkgIHhnX3NldF9jdXJzb3IgKHcsIEZSQU1FX0RJU1BMQVlfSU5G TyAoZiktPnhnX2N1cnNvcik7CisJfQogICAgIH0KICAgZWxzZQogICAgIHsKICAgICAgIGZwcmlu dGYgKHN0ZGVyciwgImJhZCB0eXBlIGluIHhnX2NyZWF0ZV93aWRnZXQ6ICVzLCBkb2luZyBub3Ro aW5nXG4iLAotICAgICAgICAgICAgICAgdHlwZSk7CisJICAgICAgIHR5cGUpOwogICAgIH0KIAog ICByZXR1cm4gdzsKQEAgLTI3NzQsOCArMjc3NCw4IEBAIHhnX3VwZGF0ZV9tZW51YmFyIChHdGtX aWRnZXQgKm1lbnViYXIsCiAKICAgICAgIC8qIEFkZCBhIGJsYW5rIGVudHJ5IHNvIHRoZSBtZW51 YmFyIGRvZXNuJ3QgY29sbGFwc2UgdG8gbm90aGluZy4gKi8KICAgICAgIGd0a19tZW51X3NoZWxs X2luc2VydCAoR1RLX01FTlVfU0hFTEwgKG1lbnViYXIpLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBndGtfbWVudV9pdGVtX25ld193aXRoX2xhYmVsICgiIiksCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgIDApOworCQkJICAgICBndGtfbWVudV9pdGVtX25ld193aXRoX2xhYmVs ICgiIiksCisJCQkgICAgIDApOwogICAgICAgLyogQWxsIHVwZGF0ZWQuICAqLwogICAgICAgdmFs ID0gMDsKICAg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VRFTSAoaXRlcjItPmRhdGEpOwor CSAgdmFsX2luX21lbnViYXIgPSB4Z19pdGVtX2xhYmVsX3NhbWVfcCAod2l0ZW0yLCB2YWwtPm5h bWUpOworCX0KIAogICAgICAgLyogU2VlIGlmIHRoZSBjdXJyZW50IGVudHJ5IChpdGVyKSBpcyBw cmVzZW50IGxhdGVyIGluIHRoZQotICAgICAgICAgc3BlY2lmaWNhdGlvbiBmb3IgdGhlIG5ldyBt ZW51IGJhci4gICovCisJIHNwZWNpZmljYXRpb24gZm9yIHRoZSBuZXcgbWVudSBiYXIuICAqLwog ICAgICAgZm9yIChjdXIgPSB2YWw7IGN1ciAmJiAhIGl0ZXJfaW5fbmV3X21lbnViYXI7IGN1ciA9 IGN1ci0+bmV4dCkKLSAgICAgICAgaXRlcl9pbl9uZXdfbWVudWJhciA9IHhnX2l0ZW1fbGFiZWxf c2FtZV9wICh3aXRlbSwgY3VyLT5uYW1lKTsKKwlpdGVyX2luX25ld19tZW51YmFyID0geGdfaXRl bV9sYWJlbF9zYW1lX3AgKHdpdGVtLCBjdXItPm5hbWUpOwogCiAgICAgICBpZiAodmFsX2luX21l bnViYXIgJiYgISBpdGVyX2luX25ld19tZW51YmFyKQotICAgICAgICB7Ci0gICAgICAgICAgaW50 IG5yID0gcG9zOwotCi0gICAgICAgICAgLyogIFRoaXMgY29ycmVzcG9uZHMgdG86Ci0gICAgICAg ICAgICAgICAgQ3VycmVudDogIEEgQiBDCi0gICAgICAgICAgICAgICAgTmV3OiAgICAgIEEgQwot ICAgICAgICAgICAgICBSZW1vdmUgQi4gICovCi0KLSAgICAgICAgICBnX29iamVjdF9yZWYgKEdf T0JKRUNUICh3aXRlbSkpOwotICAgICAgICAgIGd0a19jb250YWluZXJfcmVtb3ZlIChHVEtfQ09O VEFJTkVSIChtZW51YmFyKSwgR1RLX1dJREdFVCAod2l0ZW0pKTsKLSAgICAgICAgICBndGtfd2lk Z2V0X2Rlc3Ryb3kgKEdUS19XSURHRVQgKHdpdG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Ag ICAgICAgICAgICAgQ3VycmVudDogIEEgQiBDCi0gICAgICAgICAgICAgICAgTmV3OiAgICAgIEEg WCBDCi0gICAgICAgICAgICAgIFJlbmFtZSBCIHRvIFguICBUaGlzIG1pZ2h0IHNlZW0gdG8gYmUg YSBzdHJhbmdlIHRoaW5nIHRvIGRvLAotICAgICAgICAgICAgICBzaW5jZSBpZiB0aGVyZSBpcyBh IG1lbnUgdW5kZXIgQiBpdCB3aWxsIGJlIHRvdGFsbHkgd3JvbmcgZm9yIFguCi0gICAgICAgICAg ICAgIEJ1dCBjb25zaWRlciBlZGl0aW5nIGEgQyBmaWxlLiAgVGhlbiB0aGVyZSBpcyBhIEMtbW9k ZSBtZW51Ci0gICAgICAgICAgICAgIChjb3JyZXNwb25kcyB0byBCIGFib3ZlKS4KLSAgICAgICAg ICAgICAgSWYgdGhlbiBkb2luZyBDLXggQy1mIHRoZSBtaW5pYnVmIG1lbnUgKFggYWJvdmUpIHJl cGxhY2VzIHRoZQotICAgICAgICAgICAgICBDLW1vZGUgbWVudS4gIFdoZW4gcmV0dXJuaW5nIGZy b20gdGhlIG1pbmlidWZmZXIsIHdlIGdldAotICAgICAgICAgICAgICBiYWNrIHRoZSBDLW1vZGUg bWVudS4gIFRodXMgd2UgZG86Ci0gICAgICAgICAgICAgICAgUmVuYW1lIEIgdG8gWCAoQy1tb2Rl IHRvIG1pbmlidWYgbWVudSkKLSAgICAgICAgICAgICAgICBSZW5hbWUgWCB0byBCIChtaW5pYnVm IHRvIEMtbW9kZSBtZW51KS4KLSAgICAgICAgICAgICAgSWYgdGhlIFggbWVudSBoYXNuJ3QgYmVl biBpbnZva2VkLCB0aGUgbWVudSB1bmRlciBCCi0gICAgICAgICAgICAgIGlzIHVwIHRvIGRhdGUg d2hlbiBsZWF2aW5nIHRoZSBtaW5pYnVmZmVyLiAgKi8KLSAgICAgICAgICBHdGtMYWJlbCAqd2xh YmVsID0gR1RLX0xBQkVMIChYR19CSU5fQ0hJTEQgKHdpdGV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ZW0pLCAibGFiZWwiKTsKKwkgIGdfb2JqZWN0X25vdGlmeSAoR19PQkpFQ1QgKHdpdGVtKSwg ImxhYmVsIik7CiAjZW5kaWYKLSAgICAgICAgICBpZiAodXRmOF9sYWJlbCkgZ19mcmVlICh1dGY4 X2xhYmVsKTsKLSAgICAgICAgICBpdGVyID0gZ19saXN0X25leHQgKGl0ZXIpOwotICAgICAgICAg IHZhbCA9IHZhbC0+bmV4dDsKLSAgICAgICAgICArK3BvczsKLSAgICAgICAgfQorCSAgaWYgKHV0 ZjhfbGFiZWwpIGdfZnJlZSAodXRmOF9sYWJlbCk7CisJICBpdGVyID0gZ19saXN0X25leHQgKGl0 ZXIpOworCSAgdmFsID0gdmFsLT5uZXh0OworCSAgKytwb3M7CisJfQogICAgICAgZWxzZSBpZiAo ISB2YWxfaW5fbWVudWJhciAmJiBpdGVyX2luX25ld19tZW51YmFyKQotICAgICAgICB7Ci0gICAg ICAgICAgLyogIFRoaXMgY29ycmVzcG9uZHMgdG86Ci0gICAgICAgICAgICAgICAgQ3VycmVudDog IEEgQiBDCi0gICAgICAgICAgICAgICAgTmV3OiAgICAgIEEgWCBCIEMKLSAgICAgICAgICAgICAg SW5zZXJ0IFguICAqLwotCi0gICAgICAgICAgaW50IG5yID0gcG9zOwotICAgICAgICAgIEdTTGlz dCAqZ3JvdXAgPSAwOwotICAgICAgICAgIEd0a1dpZGdldCAqdyA9IHhnX2NyZWF0ZV9vbmVfbWVu dWl0ZW0gKHZhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IHNlbGVjdF9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBoaWdobGlnaHRfY2IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgY2xfZGF0YSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmZ3JvdXApOwotCi0gICAgICAgICAgLyogQ3JlYXRlIGEgcG9zc2libHkg ZW1wdHkgc3VibWVudSBmb3IgbWVudSBiYXIgaXRlbXMsIHNpbmNlIHNvbWUKLSAgICAgICAgICAg ICB0aGVtZXMgZG9uJ3QgaGlnaGxpZ2h0IGl0ZW1zIGNvcnJlY3RseSB3aXRob3V0IGl0LiAqLwot ICAgICAgICAgIEd0a1dpZGdldCAqc3VibWVudSA9IGNyZWF0ZV9tZW51cyAoTlVMTCwgZiwKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNlbGVjdF9jYiwgZGVh Y3RpdmF0ZV9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGhpZ2hsaWdodF9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIDAsIDAsIDAsIGNsX2RhdGEsIDApOwotCi0gICAgICAgICAgZ3RrX3dpZGdldF9zZXRfbmFt ZSAodywgTUVOVV9JVEVNX05BTUUpOwotICAgICAgICAgIGd0a19tZW51X3NoZWxsX2luc2VydCAo R1RLX01FTlVfU0hFTEwgKG1lbnViYXIpLCB3LCBwb3MpOwotICAgICAgICAgIGd0a19tZW51X2l0 ZW1fc2V0X3N1Ym1lbnUgKEdUS19NRU5VX0lURU0gKHcpLCBzdWJtZW51KTsKLQotICAgICAgICAg IGdfbGlzdF9mcmVlICgqbGlzdCk7Ci0gICAgICAgICAgKmxpc3QgPSBpdGVyID0gZ3RrX2NvbnRh aW5lcl9nZXRfY2hpbGRyZW4gKEdUS19DT05UQUlORVIgKG1lbnViYXIpKTsKLSAgICAgICAgICB3 aGlsZSAobnItLSA+IDApIGl0ZXIgPSBnX2xpc3RfbmV4dCAoaXRlcik7Ci0gICAgICAgICAgaXRl ciA9IGdfbGlzdF9uZXh0IChpdG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XRlciA9IGd0a19jb250YWlu ZXJfZ2V0X2NoaWxkcmVuIChHVEtfQ09OVEFJTkVSIChtZW51YmFyKSk7CisJICB3aGlsZSAobnIt LSA+IDApIGl0ZXIgPSBnX2xpc3RfbmV4dCAoaXRlcik7CisJICBpdGVyID0gZ19saXN0X25leHQg KGl0ZXIpOworCSAgdmFsID0gdmFsLT5uZXh0OworCSAgKytwb3M7CisJfQogICAgICAgZWxzZSAv KiBpZiAodmFsX2luX21lbnViYXIgJiYgaXRlcl9pbl9uZXdfbWVudWJhcikgKi8KLSAgICAgICAg ewotICAgICAgICAgIGludCBuciA9IHBvczsKLSAgICAgICAgICAvKiAgVGhpcyBjb3JyZXNwb25k cyB0bzoKLSAgICAgICAgICAgICAgICBDdXJyZW50OiAgQSBCIEMKLSAgICAgICAgICAgICAgICBO ZXc6ICAgICAgQSBDIEIKLSAgICAgICAgICAgICAgTW92ZSBDIGJlZm9yZSBCICAqLwotCi0gICAg ICAgICAgZ19vYmplY3RfcmVmIChHX09CSkVDVCAod2l0ZW0yKSk7Ci0gICAgICAgICAgZ3RrX2Nv bnRhaW5lcl9yZW1vdmUgKEdUS19DT05UQUlORVIgKG1lbnViYXIpLCBHVEtfV0lER0VUICh3aXRl bTIpKTsKLSAgICAgICAgICBndGtfbWVudV9zaGVsbF9pbnNlcnQgKEdUS19NRU5VX1NIRUxMICht ZW51YmFyKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdUS19XSURHRVQgKHdp dGVtMiksIHBvcyk7Ci0gICAgICAgICAgZ19vYmplY3RfdW5yZWYgKEdfT0JKRUNUICh3aXRlbTIp KTsKLQotICAgICAgICAgIGdfbGlzdF9mcmVlICgqbGlzdCk7Ci0gICAgICAgICAgKmxpc3QgPSBp dGVyID0gZ3RrX2NvbnRhaW5lcl9nZXRfY2hpbGRyZW4gKEdUS19DT05UQUlORVIgKG1lbnViYXIp KTsKLSAgICAgICAgICB3aGlsZSAobnItLSA+IDApIGl0ZXIgPS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lbnUgKHdpdGVtKTsKLSAgICAgICAgaWYgKHN1YiAm JiAhIGN1ci0+Y29udGVudHMpCi0gICAgICAgICAgewotICAgICAgICAgICAgLyogTm90IGEgc3Vi bWVudSBhbnltb3JlLiAgKi8KLSAgICAgICAgICAgIGdfb2JqZWN0X3JlZiAoR19PQkpFQ1QgKHN1 YikpOwotICAgICAgICAgICAgcmVtb3ZlX3N1Ym1lbnUgKHdpdGVtKTsKLSAgICAgICAgICAgIGd0 a193aWRnZXRfZGVzdHJveSAoc3ViKTsKLSAgICAgICAgICB9Ci0gICAgICAgIGVsc2UgaWYgKGN1 ci0+Y29udGVudHMpCi0gICAgICAgICAgewotICAgICAgICAgICAgR3RrV2lkZ2V0ICpuc3ViOwot Ci0gICAgICAgICAgICBuc3ViID0geGdfdXBkYXRlX3N1Ym1lbnUgKHN1YiwgZiwgY3VyLT5jb250 ZW50cywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc2VsZWN0X2NiLCBk ZWFjdGl2YXRlX2NiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBoaWdo bGlnaHRfY2IsIGNsX2RhdGEpOwotCi0gICAgICAgICAgICAvKiBJZiB0aGlzIGl0ZW0ganVzdCBi ZWNhbWUgYSBzdWJtZW51LCB3ZSBtdXN0IHNldCBpdC4gICovCi0gICAgICAgICAgICBpZiAobnN1 YiAhPSBzdWIpCi0gICAgICAgICAgICAgIGd0a19tZW51X2l0ZW1fc2V0X3N1Ym1lbnUgKHdpdGVt LCBuc3ViKTsKLSAgICAgICAgICB9CisJR3RrTWVudUl0ZW0gKndpdGVtID0gR1RLX01FTlVfSVRF TSAodyk7CisJR3RrV2lkZ2V0ICpzdWI7CisKKwlpZiAoY3VyLT5idXR0b25fdHlwZSAhPSBCVVRU T05fVFlQRV9OT05FIHx8CisJICAgIG1lbnVfc2VwYXJhdG9yX25hbWVfcCAoY3VyLT5uYW1lKSkK KwkgIGJyZWFrOworCisJeGdfd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GFuZCBkb3duCisJICAgaW4gU1VCTUVO VS4gICovCisJYnJlYWs7CiAgICAgICB9CiAgIH0KIApAQCAtMzE3NSw3ICszMTc1LDcgQEAgeGdf dXBkYXRlX3N1Ym1lbnUgKEd0a1dpZGdldCAqc3VibWVudSwKICAgaWYgKGl0ZXIpCiAgICAgewog ICAgICAgLyogSWYgd2UgYXJlIGFkZGluZyBuZXcgbWVudSBpdGVtcyBiZWxvdywgd2UgbXVzdCBy ZW1vdmUgZnJvbQotICAgICAgICAgZmlyc3QgcmFkaW8gYnV0dG9uIHNvIHRoYXQgcmFkaW8gZ3Jv dXBzIGJlY29tZSBjb3JyZWN0LiAgKi8KKwkgZmlyc3QgcmFkaW8gYnV0dG9uIHNvIHRoYXQgcmFk aW8gZ3JvdXBzIGJlY29tZSBjb3JyZWN0LiAgKi8KICAgICAgIGlmIChjdXIgJiYgZmlyc3RfcmFk aW8pIHhnX2Rlc3Ryb3lfd2lkZ2V0cyAoZmlyc3RfcmFkaW8pOwogICAgICAgZWxzZSB4Z19kZXN0 cm95X3dpZGdldHMgKGl0ZXIpOwogICAgIH0KQEAgLTMxODQsMTUgKzMxODQsMTUgQEAgeGdfdXBk YXRlX3N1Ym1lbnUgKEd0a1dpZGdldCAqc3VibWVudSwKICAgICB7CiAgICAgICAvKiBNb3JlIGl0 ZW1zIGFkZGVkLiAgQ3JlYXRlIHRoZW0uICAqLwogICAgICAgbmV3c3ViID0gY3JlYXRlX21lbnVz IChjdXIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHNlbGVjdF9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZGVh Y3RpdmF0ZV9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGlnaGxpZ2h0X2NiLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAwLAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAwLAotICAgICAgICAg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Ag IEd0a1dpZGdldCAqbmV3c3ViOwotICAgICAgICAgIEd0a01lbnVJdGVtICp3aXRlbSA9IDA7Ci0K LSAgICAgICAgICAvKiBGaW5kIHN1YiBtZW51IHRoYXQgY29ycmVzcG9uZHMgdG8gdmFsIGFuZCB1 cGRhdGUgaXQuICAqLwotICAgICAgICAgIGZvciAoaXRlciA9IGxpc3QgOyBpdGVyOyBpdGVyID0g Z19saXN0X25leHQgKGl0ZXIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICB3aXRlbSA9 IEdUS19NRU5VX0lURU0gKGl0ZXItPmRhdGEpOwotICAgICAgICAgICAgICBpZiAoeGdfaXRlbV9s YWJlbF9zYW1lX3AgKHdpdGVtLCBjdXItPm5hbWUpKQotICAgICAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgICAgIHN1YiA9IGd0a19tZW51X2l0ZW1fZ2V0X3N1Ym1lbnUgKHdpdGVtKTsKLSAg ICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0K LQotICAgICAgICAgIG5ld3N1YiA9IHhnX3VwZGF0ZV9zdWJtZW51IChzdWIsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGN1ci0+Y29udGVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHNlbGVjdF9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgZGVhY3RpdmF0ZV9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg aGlnaGxpZ2h0X2NiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBjbF9k YXRhKTsKLSAgICAgICAgICAvKiBzdWIgbWF5IHN0aWxsIGJlIE5VTEwuICBJZiB3ZSBqdXN0IHVw ZGF0ZWQgbm9uIGRlZXAg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A8IEZSQU1FX01FTlVCQVJfSEVJ R0hUIChmKQorCSAmJiBldmVudC0+eGJ1dHRvbi5zYW1lX3NjcmVlbikpCiAgICAgcmV0dXJuIDA7 CiAKICAgZ2RweSA9IGdka194MTFfbG9va3VwX3hkaXNwbGF5IChGUkFNRV9YX0RJU1BMQVkgKGYp KTsKQEAgLTMzOTIsNyArMzM5Miw3IEBAIHhnX2V2ZW50X2lzX2Zvcl9tZW51YmFyIChzdHJ1Y3Qg ZnJhbWUgKmYsIGNvbnN0IFhFdmVudCAqZXZlbnQpCiAgICAgewogICAgICAgR3RrV2lkZ2V0ICp3 ID0gR1RLX1dJREdFVCAoaXRlci0+ZGF0YSk7CiAgICAgICBpZiAoZ3RrX3dpZGdldF9nZXRfbWFw cGVkICh3KSAmJiBndGtfd2lkZ2V0X2ludGVyc2VjdCAodywgJnJlYywgTlVMTCkpCi0gICAgICAg IGJyZWFrOworCWJyZWFrOwogICAgIH0KICAgZ19saXN0X2ZyZWUgKGxpc3QpOwogICByZXR1cm4g aXRlciAhPSAwOwpAQCAtMzQwMSw3ICszNDAxLDcgQEAgeGdfZXZlbnRfaXNfZm9yX21lbnViYXIg KHN0cnVjdCBmcmFtZSAqZiwgY29uc3QgWEV2ZW50ICpldmVudCkKIAogDAogLyoqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqCi0gICAgICAgICAgICAgICAgICAgICAgU2Nyb2xsIGJhciBmdW5jdGlvbnMKKwkJICAgICAg U2Nyb2xsIGJhciBmdW5jdGlvbnMKICAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKi8KIAogCkBAIC0zNDQ3LDcgKzM0 NDcsNyBAQCB4Z19zdG9yZV93aWRnZXRfaW5fbWFwIChHdGtXaWRnZXQgKncpCiAJCQkJCW5ld19z aXplLCBzaXplb2YgKEd0a1dpZGdldCAqKSk7CiAKICAgICAgIGZvciAoaSA9IGlkX3RvX3dpZGdl dC5tYXhfc2l6ZTsgaSA8IG5ld19zaXplOyArK2kpCi0gICAgICAgIGlkX3RvX3dpZGdldC53aWRn ZXRzW2ldID0gMDsKKwlpZF90b193aWRnZXQud2lkZ2V0c1tpXSA9IDA7CiAgICAgICBpZF90b193 aWRnZXQubWF4X3NpemUgPSBuZXdfc2l6ZTsKICAgICB9CiAKQEAgLTM0NTcsMTIgKzM0NTcsMTIg QEAgeGdfc3RvcmVfd2lkZ2V0X2luX21hcCAoR3RrV2lkZ2V0ICp3KQogICBmb3IgKGkgPSAwOyBp IDwgaWRfdG9fd2lkZ2V0Lm1heF9zaXplOyArK2kpCiAgICAgewogICAgICAgaWYgKCEgaWRfdG9f d2lkZ2V0LndpZGdldHNbaV0pCi0gICAgICAgIHsKLSAgICAgICAgICBpZF90b193aWRnZXQud2lk Z2V0c1tpXSA9IHc7Ci0gICAgICAgICAgKytpZF90b193aWRnZXQudXNlZDsKKwl7CisJICBpZF90 b193aWRnZXQud2lkZ2V0c1tpXSA9IHc7CisJICArK2lkX3RvX3dpZGdldC51c2VkOwogCi0gICAg ICAgICAgcmV0dXJuIGk7Ci0gICAgICAgIH0KKwkgIHJldHVybiBpOworCX0KICAgICB9CiAKICAg LyogU2hvdWxkIG5ldmVyIGVuZCB1cCBoZXJlICAqLwpAQCAtMzU2Niw4ICszNTY2LDggQEAgeGdf Z2V0X3Njcm9sbF9pZF9mb3Jfd2luZG93IChEaXNwbGF5ICpkcHksIFdpbmRvdyB3aWQpCiAgIGlm ICh3KQogICAgIHsKICAgICAgIGZvciAoaWR4ID0gMDsgaWR4IDwgaWRfdG9fd2lkZ2V0Lm1heF9z aXplOyArK2lkeCkKLSAgICAgICAgaWYgKGlkX3RvX3dpZGdldC53aWRnZXRzW2lkeF0gPT0gdykK LSAgICAgICAgICByZXR1cm4gaWR4OworCWlmIChpZF90b193aWRnZXQud2lkZ2V0c1tpZHhdID09 IHcpCisJICByZ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ICBnX3NpZ25hbF9jb25uZWN0IChH X09CSkVDVCAod3Njcm9sbCksCi0gICAgICAgICAgICAgICAgICAgICJkZXN0cm95IiwKLSAgICAg ICAgICAgICAgICAgICAgR19DQUxMQkFDSyAoeGdfZ3RrX3Njcm9sbF9kZXN0cm95KSwKLSAgICAg ICAgICAgICAgICAgICAgKGdwb2ludGVyKSBzY3JvbGxfaWQpOworCQkgICAgImRlc3Ryb3kiLAor CQkgICAgR19DQUxMQkFDSyAoeGdfZ3RrX3Njcm9sbF9kZXN0cm95KSwKKwkJICAgIChncG9pbnRl cikgc2Nyb2xsX2lkKTsKICAgZ19zaWduYWxfY29ubmVjdCAoR19PQkpFQ1QgKHdzY3JvbGwpLAot ICAgICAgICAgICAgICAgICAgICAiY2hhbmdlLXZhbHVlIiwKLSAgICAgICAgICAgICAgICAgICAg c2Nyb2xsX2NhbGxiYWNrLAotICAgICAgICAgICAgICAgICAgICAoZ3BvaW50ZXIpIGJhcik7CisJ CSAgICAiY2hhbmdlLXZhbHVlIiwKKwkJICAgIHNjcm9sbF9jYWxsYmFjaywKKwkJICAgIChncG9p bnRlcikgYmFyKTsKICAgZ19zaWduYWxfY29ubmVjdCAoR19PQkpFQ1QgKHdzY3JvbGwpLAotICAg ICAgICAgICAgICAgICAgICAiYnV0dG9uLXJlbGVhc2UtZXZlbnQiLAotICAgICAgICAgICAgICAg ICAgICBlbmRfY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgIChncG9pbnRlcikgYmFyKTsK KwkJICAgICJidXR0b24tcmVsZWFzZS1ldmVudCIsCisJCSAgICBlbmRfY2FsbGJhY2ssCisJCSAg ICAoZ3BvaW50ZXIpIGJhcik7CiAKICAgLyogVGhlIHNjcm9sbCBiYXIgd2lkZ2V0IGRvZXMgbm90 IGRyYXcgb24gYSB3aW5kb3cgb2YgaXRzIG93bi4gIEluc3RlYWQKICAgICAgaXQgZHJhd3Mgb24g dGhlIHBhcmVudCB3aW5kb3csIGluIHRoaXMgY2Fz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yYW5nZSkKIAogdm9pZAogeGdfc2V0X3Rv b2xraXRfc2Nyb2xsX2Jhcl90aHVtYiAoc3RydWN0IHNjcm9sbF9iYXIgKmJhciwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwb3J0aW9uLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgaW50IHBvc2l0aW9uLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgaW50IHdob2xlKQorCQkJCSBpbnQgcG9ydGlvbiwKKwkJCQkgaW50IHBvc2l0aW9uLAor CQkJCSBpbnQgd2hvbGUpCiB7CiAgIEd0a1dpZGdldCAqd3Njcm9sbCA9IHhnX2dldF93aWRnZXRf ZnJvbV9tYXAgKGJhci0+eF93aW5kb3cpOwogCkBAIC0zODg1LDI0ICszODg1LDI0IEBAIHhnX3Nl dF90b29sa2l0X3Njcm9sbF9iYXJfdGh1bWIgKHN0cnVjdCBzY3JvbGxfYmFyICpiYXIsCiAgICAg ICBhZGogPSBndGtfcmFuZ2VfZ2V0X2FkanVzdG1lbnQgKEdUS19SQU5HRSAod3Njcm9sbCkpOwog CiAgICAgICBpZiAoc2Nyb2xsX2Jhcl9hZGp1c3RfdGh1bWJfcG9ydGlvbl9wKQotICAgICAgICB7 Ci0gICAgICAgICAgLyogV2UgZG8gdGhlIHNhbWUgYXMgZm9yIE1PVElGIGluIHh0ZXJtLmMsIHVz ZSAzMCBjaGFycyBwZXIKLSAgICAgICAgICAgICBsaW5lIHJhdGhlciB0aGFuIHRoZSByZWFsIHBv cnRpb24gdmFsdWUuICBUaGlzIG1ha2VzIHRoZQotICAgICAgICAgICAgIHRodW1iIGxlc3MgbGlr ZWx5IHRvIHJlc2l6ZSBhbmQgdGhhdCBsb29rcyBiZXR0ZXIuICAqLwotICAgICAgICAgIHBvcnRp b24gPSBXSU5ET1dfVE9UQUxfTElORVMgKFhXSU5ET1cgKGJhci0+d2luZG93KSkgKiAzMDsKLQot ICAgICAgICAgIC8qI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b3BlcmF0 aW9uX3J1biAocHJpbnQsIEdUS19QUklOVF9PUEVSQVRJT05fQUNUSU9OX1BSSU5UX0RJQUxPRywK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIE5VTEwpOworCQkJCSBOVUxM LCBOVUxMKTsKICAgaWYgKHJlcyA9PSBHVEtfUFJJTlRfT1BFUkFUSU9OX1JFU1VMVF9BUFBMWSkK ICAgICB7CiAgICAgICBpZiAocHJpbnRfc2V0dGluZ3MgIT0gTlVMTCkKLSAgICAgICAgZ19vYmpl Y3RfdW5yZWYgKHByaW50X3NldHRpbmdzKTsKKwlnX29iamVjdF91bnJlZiAocHJpbnRfc2V0dGlu Z3MpOwogICAgICAgcHJpbnRfc2V0dGluZ3MgPQogCWdfb2JqZWN0X3JlZiAoZ3RrX3ByaW50X29w ZXJhdGlvbl9nZXRfcHJpbnRfc2V0dGluZ3MgKHByaW50KSk7CiAgICAgfQpAQCAtNDEyMSw3ICs0 MTIxLDcgQEAgeGdfcHJpbnRfZnJhbWVzX2RpYWxvZyAoTGlzcF9PYmplY3QgZnJhbWVzKQogCiAM CiAvKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioKLSAgICAgICAgICAgICAgICAgICAgICBUb29sIGJhciBmdW5jdGlv bnMKKwkJICAgICAgVG9vbCBiYXIgZnVuY3Rpb25zCiAgKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKiovCiAvKiBUaGUg a2V5IGZvciB0aGUgZGF0YSB3ZSBwdXQgaW4gdGhlIEd0a0ltYWdlIHdpZGdldHMuICBUaGUgZGF0 YSBpcwogICAgdGhlIGltYWdlIHVzZWQgYnkgRW1hY3MuICBXZSB1c2UgdGhpcyB0byBzZWUgaWYg d2UgbmVlZCB0byB1cGRhdGUKQEAgLTQxNDgsOCArNDE0OCw4IEBAIHhn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ICAgICAgID8gR1RL X09SSUVOVEFUSU9OX1ZFUlRJQ0FMCi0gICAgICAgICAgICAgICAgICAgICAgICAgICA6IEdUS19P UklFTlRBVElPTl9IT1JJWk9OVEFMKTsKKwkJCSAgIGludG9faGJveAorCQkJICAgPyBHVEtfT1JJ RU5UQVRJT05fVkVSVElDQUwKKwkJCSAgIDogR1RLX09SSUVOVEFUSU9OX0hPUklaT05UQUwpOwog CiAgIGlmIChpbnRvX2hib3gpCiAgICAgewogICAgICAgZ3RrX2JveF9wYWNrX3N0YXJ0IChHVEtf Qk9YICh4LT5oYm94X3dpZGdldCksIHRvcF93aWRnZXQsCi0gICAgICAgICAgICAgICAgICAgICAg ICAgIEZBTFNFLCBGQUxTRSwgMCk7CisJCQkgIEZBTFNFLCBGQUxTRSwgMCk7CiAKICAgICAgIGlm IChFUSAocG9zLCBRbGVmdCkpCi0gICAgICAgIGd0a19ib3hfcmVvcmRlcl9jaGlsZCAoR1RLX0JP WCAoeC0+aGJveF93aWRnZXQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRvcF93 aWRnZXQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7CisJZ3RrX2JveF9yZW9y ZGVyX2NoaWxkIChHVEtfQk9YICh4LT5oYm94X3dpZGdldCksCisJCQkgICAgICAgdG9wX3dpZGdl dCwKKwkJCSAgICAgICAwKTsKICAgICAgIHgtPnRvb2xiYXJfaW5faGJveCA9IHRydWU7CiAgICAg fQogICBlbHNlCiAgICAgewogICAgICAgYm9vbCB2Ym94X3BvcyA9IHgtPm1lbnViYXJfd2lkZ2V0 ICE9IDA7CiAgICAgICBndGtfYm94X3BhY2tfc3RhcnQgKEdUS19CT1ggKHgtPnZib3hfd2lkZ2V0 KSwgdG9wX3dpZGdldCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgRkFMU0UsIEZBTFNFLCAw KTsKKwkJCSAgRkFMU0UsIEZBTFNFLCAwKTsKIAogICAgICAgaWYgKEVRI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hbWVfbm9uZGlyZWN0b3J5IChmaWxlKSk7CisJICBpZiAoISBOSUxQIChGZXF1YWwgKGZp bGUsIHJ0bF9uYW1lKSkpCisJICAgIHsKKwkgICAgICBpbWFnZSA9IHJ0bF9pbWFnZTsKKwkgICAg ICBicmVhazsKKwkgICAgfQorCX0KICAgICB9CiAKICAgcmV0dXJuIGltYWdlOwpAQCAtNDQyOCwx NiArNDQyOCwxNiBAQCBmaW5kX3J0bF9pbWFnZSAoc3RydWN0IGZyYW1lICpmLCBMaXNwX09iamVj dCBpbWFnZSwgTGlzcF9PYmplY3QgcnRsKQogCiBzdGF0aWMgR3RrVG9vbEl0ZW0gKgogeGdfbWFr ZV90b29sX2l0ZW0gKHN0cnVjdCBmcmFtZSAqZiwKLSAgICAgICAgICAgICAgICAgICBHdGtXaWRn ZXQgKndpbWFnZSwKLSAgICAgICAgICAgICAgICAgICBHdGtXaWRnZXQgKip3YnV0dG9uLAotICAg ICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmxhYmVsLAotICAgICAgICAgICAgICAgICAgIGlu dCBpLCBib29sIGhvcml6LCBib29sIHRleHRfaW1hZ2UpCisJCSAgIEd0a1dpZGdldCAqd2ltYWdl LAorCQkgICBHdGtXaWRnZXQgKip3YnV0dG9uLAorCQkgICBjb25zdCBjaGFyICpsYWJlbCwKKwkJ ICAgaW50IGksIGJvb2wgaG9yaXosIGJvb2wgdGV4dF9pbWFnZSkKIHsKICAgR3RrVG9vbEl0ZW0g KnRpID0gZ3RrX3Rvb2xfaXRlbV9uZXcgKCk7CiAgIEd0a1dpZGdldCAqdmIgPSBndGtfYm94X25l dyAoaG9yaXoKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA/IEdUS19PUklFTlRBVElP Tl9IT1JJWk9OVEFMCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBHVEtfT1JJRU5U QVRJT05fVkVSVElDQUwsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCk7C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9kYXRh IChHX09CSkVDVCAod2IpLCBYR19GUkFNRV9EQVRBLCAoZ3BvaW50ZXIpZik7CiAKICAgICAgIC8q IFVzZSBlbnRlci9sZWF2ZSBub3RpZnkgdG8gc2hvdyBoZWxwLiAgV2UgdXNlIHRoZSBldmVudHMK LSAgICAgICAgIHJhdGhlciB0aGFuIHRoZSBHdGtCdXR0b24gc3BlY2lmaWMgc2lnbmFscyAiZW50 ZXIiIGFuZAotICAgICAgICAgImxlYXZlIiwgc28gd2UgY2FuIGhhdmUgb25seSBvbmUgY2FsbGJh Y2suICBUaGUgZXZlbnQKLSAgICAgICAgIHdpbGwgdGVsbCB1cyB3aGF0IGtpbmQgb2YgZXZlbnQg aXQgaXMuICAqLworCSByYXRoZXIgdGhhbiB0aGUgR3RrQnV0dG9uIHNwZWNpZmljIHNpZ25hbHMg ImVudGVyIiBhbmQKKwkgImxlYXZlIiwgc28gd2UgY2FuIGhhdmUgb25seSBvbmUgY2FsbGJhY2su ICBUaGUgZXZlbnQKKwkgd2lsbCB0ZWxsIHVzIHdoYXQga2luZCBvZiBldmVudCBpdCBpcy4gICov CiAgICAgICBnX3NpZ25hbF9jb25uZWN0IChHX09CSkVDVCAod2V2ZW50Ym94KSwKLSAgICAgICAg ICAgICAgICAgICAgICAgICJlbnRlci1ub3RpZnktZXZlbnQiLAotICAgICAgICAgICAgICAgICAg ICAgICAgR19DQUxMQkFDSyAoeGdfdG9vbF9iYXJfaGVscF9jYWxsYmFjayksCi0gICAgICAgICAg ICAgICAgICAgICAgICBnaSk7CisJCQkiZW50ZXItbm90aWZ5LWV2ZW50IiwKKwkJCUdfQ0FMTEJB Q0sgKHhnX3Rvb2xfYmFyX2hlbHBfY2FsbGJhY2spLAorCQkJZ2kpOwogICAgICAgZ19zaWduYWxf Y29ubmVjdCAoR19PQkpFQ1QgKHdldmVudGJveCksCi0gICAgICAgICAgICAgICAgICAgICAgICAi bGVhdmUtbm90aWZ5LWV2ZW50IiwKLSAgICAgICAgICAgICAg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CisJCQkJCSAgICAgWEdfVE9PTF9CQVJfSU1BR0VfREFUQSk7CiAgICAgICBQaXht YXAgb2xkX2ltZyA9IChQaXhtYXApIGdvbGRfaW1nOwogICAgICAgaWYgKG9sZF9pbWcgIT0gaW1n LT5waXhtYXApCiAJcmV0dXJuIDE7CkBAIC00NTk4LDggKzQ1OTgsOCBAQCB4Z191cGRhdGVfdG9v bF9iYXJfc2l6ZXMgKHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBpbnQgcG9zOwogICAg ICAgZ3RrX2NvbnRhaW5lcl9jaGlsZF9nZXQgKEdUS19DT05UQUlORVIgKHgtPmhib3hfd2lkZ2V0 KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0b3Bfd2lkZ2V0LAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICJwb3NpdGlvbiIsICZwb3MsIE5VTEwpOworCQkJICAgICAg IHRvcF93aWRnZXQsCisJCQkgICAgICAgInBvc2l0aW9uIiwgJnBvcywgTlVMTCk7CiAgICAgICBp ZiAocG9zID09IDApIG5sID0gcmVxLndpZHRoOwogICAgICAgZWxzZSBuciA9IHJlcS53aWR0aDsK ICAgICB9CkBAIC00NjA3LDggKzQ2MDcsOCBAQCB4Z191cGRhdGVfdG9vbF9iYXJfc2l6ZXMgKHN0 cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBpbnQgcG9zOwogICAgICAgZ3RrX2NvbnRhaW5l cl9jaGlsZF9nZXQgKEdUS19DT05UQUlORVIgKHgtPnZib3hfd2lkZ2V0KSwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB0b3Bfd2lkZ2V0LAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICJwb3NpdGlvbiIsICZwb3MsIE5VTEwpOworCQkJICAgICAgIHRvcF93aWRnZXQsCisJ CQkgICAgICAgInBvc2l0aW9uIiwgJnBvcywgTlVMTCk7CiAgICAgICBpZiAocG9zID09IDAgfHwg KHBv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7CiAgICAgICBpZiAoIU5JTFAgKHNwZWNpZmllZF9maWxlKSAmJiAhTklM UCAoRmZib3VuZHAgKFF4X2d0a19tYXBfc3RvY2spKSkKLSAgICAgICAgc3RvY2sgPSBjYWxsMSAo UXhfZ3RrX21hcF9zdG9jaywgc3BlY2lmaWVkX2ZpbGUpOworCXN0b2NrID0gY2FsbDEgKFF4X2d0 a19tYXBfc3RvY2ssIHNwZWNpZmllZF9maWxlKTsKIAogICAgICAgaWYgKENPTlNQIChzdG9jaykp Ci0gICAgICAgIHsKLSAgICAgICAgICBMaXNwX09iamVjdCB0ZW07Ci0gICAgICAgICAgZm9yICh0 ZW0gPSBzdG9jazsgQ09OU1AgKHRlbSk7IHRlbSA9IFhDRFIgKHRlbSkpCi0gICAgICAgICAgICBp ZiAoISBOSUxQICh0ZW0pICYmIFNUUklOR1AgKFhDQVIgKHRlbSkpKQotICAgICAgICAgICAgICB7 Ci0gICAgICAgICAgICAgICAgc3RvY2tfbmFtZSA9IGZpbmRfaWNvbl9mcm9tX25hbWUgKFNTREFU QSAoWENBUiAodGVtKSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIGljb25fdGhlbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICZpY29uX25hbWUpOwotICAgICAgICAgICAgICAgIGlmIChzdG9ja19u YW1lIHx8IGljb25fbmFtZSkgYnJlYWs7Ci0gICAgICAgICAgICAgIH0KLSAgICAgICAgfQorCXsK KwkgIExpc3BfT2JqZWN0IHRlbTsKKwkgIGZvciAodGVtID0gc3RvY2s7IENPTlNQICh0ZW0pOyB0 ZW0gPSBYQ0RSICh0ZW0pKQorCSAgICBpZiAoISBOSUxQICh0ZW0pICYmIFNUUklOR1AgKFhDQVIg KHRlbSkpKQorCSAgICAgIHsKKwkJc3RvY2tfbmFtZSA9IGZpbmRfaWNvbl9mcm9tX25hbWUgKFNT REFUQSAoWENBUiAodGVtKSksCisJCQkJCQkgIGljb25fdGhlbWUsCisJCQkJCQkgICZpY29uX25h bWUpOworCQlpZiAoc3RvY2tfbmFtZSB8fCBpY29uX25hbWUpIGJyZWFrOworCSAgICAgIH0KKwl9 CiAgICAgICBlbHNlIGlmIChTVFJJTkdQIChzdG9jaykpCi0gICAgICAgIHsKLSAgICAgICAgICBz dG9ja19uYW1lID0gZmluZF9pY29uX2Zyb21fbmFtZSAoU1NEQVRBIChzdG9jayksCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGljb25fdGhlbWUsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZpY29uX25hbWUpOwotICAgICAg ICB9CisJeworCSAgc3RvY2tfbmFtZSA9IGZpbmRfaWNvbl9mcm9tX25hbWUgKFNTREFUQSAoc3Rv Y2spLAorCQkJCQkgICAgaWNvbl90aGVtZSwKKwkJCQkJICAgICZpY29uX25hbWUpOworCX0KIAog ICAgICAgaWYgKHN0b2NrX25hbWUgfHwgaWNvbl9uYW1lKQotICAgICAgICBpY29uX3NpemUgPSBn dGtfdG9vbGJhcl9nZXRfaWNvbl9zaXplICh3dG9vbGJhcik7CisJaWNvbl9zaXplID0gZ3RrX3Rv b2xiYXJfZ2V0X2ljb25fc2l6ZSAod3Rvb2xiYXIpOwogCiAgICAgICBpZiAoc3RvY2tfbmFtZSA9 PSBOVUxMICYmIGljb25fbmFtZSA9PSBOVUxMKQotICAgICAgICB7Ci0gICAgICAgICAgLyogTm8g c3RvY2sgaW1hZ2UsIG9yIHN0b2NrIGl0ZW0gbm90IGtub3duLiAgVHJ5IHJlZ3VsYXIKLSAgICAg ICAgICAgICBpbWFnZS4gIElmIGltYWdlIGlzIGEgdmVjdG9yLCBjaG9vc2UgaXQgYWNjb3JkaW5n IHRvIHRoZQotICAgICAgICAgICAgIGJ1dHRvbiBzdGF0ZS4gICovCi0gICAgICAgICAgaWYgKGRp ciA9PSBHVEtfVEVYVF9ESVJfUlRMCi0gICAgICAgICAgICAgICYmICFOSUxQIChydGwgPSBQUk9Q IChUT09MX0JBUl9JVEVNX1JUTF9JTUFHRSkpCi0gICAgICAgICAgICAgICYmIFNUUklOR1AgKHJ0 bCkpCisJeworCSAgLyogTm8gc3RvY2sgaW1hZ2UsIG9yIHN0b2NrIGl0ZW0gbm90IGtub3duLiAg VHJ5IHJlZ3VsYXIKKwkgICAgIGltYWdlLiAgSWYgaW1hZ2UgaXMgYSB2ZWN0b3IsIGNob29zZSBp dCBhY2NvcmRpbmcgdG8gdGhlCisJICAgICBidXR0b24gc3RhdGUuICAqLworCSAgaWYgKGRpciA9 PSBHVEtfVEVYVF9ESVJfUlRMCisJICAgICAgJiYgIU5JTFAgKHJ0bCA9IFBST1AgKFRPT0xfQkFS X0lURU1fUlRMX0lNQUdFKSkKKwkgICAgICAmJiBTVFJJTkdQIChydGwpKQogCSAgICBpbWFnZSA9 IGZpbmRfcnRsX2ltYWdlIChmLCBpbWFnZSwgcnRsKTsKIAotICAgICAgICAgIGlmIChWRUNUT1JQ IChpbWFnZSkpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGlmIChlbmFibGVkX3ApCi0g ICAgICAgICAgICAgICAgaWR4ID0gKHNlbGVjdGVkX3AKLSAgICAgICAgICAgICAgICAgICAgICAg PyBUT09MX0JBUl9JTUFHRV9FTkFCTEVEX1NFTEVDVEVECi0gICAgICAgICAgICAgICAgICAgICAg IDogVE9PTF9CQVJfSU1BR0VfRU5BQkxFRF9ERVNFTEVDVEVEKTsKLSAgICAgICAgICAgICAgZWxz ZQotICAgICAgICAgICAgICAgIGlkeCA9IChzZWxlY3RlZF9wCi0gICAgICAgICAgICAgICAgICAg ICAgID8gVE9PTF9CQVJfSU1BR0VfRElTQUJMRURfU0VMRUNURUQKLSAgICAgICAgICAgICAgICAg ICAgICAgOiBUT09MX0JBUl9JTUFHRV9ESVNBQkxFRF9ERVNFTEVDVEVEKTsKLQotICAgICAgICAg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MCkK LSAgICAgICAgICAgICAgdyA9IGd0a19pbWFnZV9uZXdfZnJvbV9pY29uX25hbWUgKHN0b2NrX25h bWUsIGljb25fc2l6ZSk7CisJICAgICAgdyA9IGd0a19pbWFnZV9uZXdfZnJvbV9pY29uX25hbWUg KHN0b2NrX25hbWUsIGljb25fc2l6ZSk7CiAjZWxzZQotICAgICAgICAgICAgICB3ID0gZ3RrX2lt YWdlX25ld19mcm9tX3N0b2NrIChzdG9ja19uYW1lLCBpY29uX3NpemUpOworCSAgICAgIHcgPSBn dGtfaW1hZ2VfbmV3X2Zyb21fc3RvY2sgKHN0b2NrX25hbWUsIGljb25fc2l6ZSk7CiAjZW5kaWYK LSAgICAgICAgICAgICAgZ19vYmplY3Rfc2V0X2RhdGFfZnVsbCAoR19PQkpFQ1QgKHcpLCBYR19U T09MX0JBUl9TVE9DS19OQU1FLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAoZ3BvaW50ZXIpIHhzdHJkdXAgKHN0b2NrX25hbWUpLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoR0Rlc3Ryb3lOb3RpZnkpIHhmcmVlKTsKLSAgICAgICAgICAgIH0K LSAgICAgICAgICBlbHNlIGlmIChpY29uX25hbWUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgIHcgPSBndGtfaW1hZ2VfbmV3X2Zyb21faWNvbl9uYW1lIChpY29uX25hbWUsIGljb25fc2l6 ZSk7Ci0gICAgICAgICAgICAgIGdfb2JqZWN0X3NldF9kYXRhX2Z1bGwgKEdfT0JKRUNUICh3KSwg WEdfVE9PTF9CQVJfSUNPTl9OQU1FLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoZ3BvaW50ZXIpIHhzdHJkdXAgKGljb25fbmFtZSksCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIChHRGVzdHJveU5vdGlmeSkgeGZyZWUpOwotICAgICAgICAgICA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TsKKwkgICAgfQogCiAjaWYgR1RLX0NI RUNLX1ZFUlNJT04gKDMsIDE0LCAwKQotICAgICAgICAgIGlmICh3KQotICAgICAgICAgICAgewot ICAgICAgICAgICAgICBndGtfd2lkZ2V0X3NldF9tYXJnaW5fc3RhcnQgKHcsIGhtYXJnaW4pOwot ICAgICAgICAgICAgICBndGtfd2lkZ2V0X3NldF9tYXJnaW5fZW5kICh3LCBobWFyZ2luKTsKLSAg ICAgICAgICAgICAgZ3RrX3dpZGdldF9zZXRfbWFyZ2luX3RvcCAodywgdm1hcmdpbik7Ci0gICAg ICAgICAgICAgIGd0a193aWRnZXRfc2V0X21hcmdpbl9ib3R0b20gKHcsIHZtYXJnaW4pOwotICAg ICAgICAgICAgfQorCSAgaWYgKHcpCisJICAgIHsKKwkgICAgICBndGtfd2lkZ2V0X3NldF9tYXJn aW5fc3RhcnQgKHcsIGhtYXJnaW4pOworCSAgICAgIGd0a193aWRnZXRfc2V0X21hcmdpbl9lbmQg KHcsIGhtYXJnaW4pOworCSAgICAgIGd0a193aWRnZXRfc2V0X21hcmdpbl90b3AgKHcsIHZtYXJn aW4pOworCSAgICAgIGd0a193aWRnZXRfc2V0X21hcmdpbl9ib3R0b20gKHcsIHZtYXJnaW4pOwor CSAgICB9CiAjZWxzZQogCSAgaWYgKHcpIGd0a19taXNjX3NldF9wYWRkaW5nIChHVEtfTUlTQyAo dyksIGhtYXJnaW4sIHZtYXJnaW4pOwogI2VuZGlmCi0gICAgICAgICAgdGkgPSB4Z19tYWtlX3Rv b2xfaXRlbSAoZiwgdywgJndidXR0b24sIGxhYmVsLCBpLCBob3JpeiwgdGV4dF9pbWFnZSk7Ci0g ICAgICAgICAgZ3RrX3Rvb2xiYXJfaW5zZXJ0IChHVEtfVE9PTEJBUiAod3Rvb2xiYXIpLCB0aSwg aik7Ci0gICAgICAgIH0KKwkgIHRpID0geGdfbWFrZV90b29sX2l0ZW0gKGYsIHcsICZ3YnV0dG9u LCBsYWJlbCwgaSwgaG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ICAgICAgICAgICB0b3Bf d2lkZ2V0KTsKLSAgICAgICAgfQorCXsKKwkgIGlmICh4LT50b29sYmFyX2luX2hib3gpCisJICAg IGd0a19jb250YWluZXJfcmVtb3ZlIChHVEtfQ09OVEFJTkVSICh4LT5oYm94X3dpZGdldCksCisJ CQkJICB0b3Bfd2lkZ2V0KTsKKwkgIGVsc2UKKwkgICAgZ3RrX2NvbnRhaW5lcl9yZW1vdmUgKEdU S19DT05UQUlORVIgKHgtPnZib3hfd2lkZ2V0KSwKKwkJCQkgIHRvcF93aWRnZXQpOworCX0KICAg ICAgIGVsc2UKLSAgICAgICAgZ3RrX3dpZGdldF9kZXN0cm95ICh4LT50b29sYmFyX3dpZGdldCk7 CisJZ3RrX3dpZGdldF9kZXN0cm95ICh4LT50b29sYmFyX3dpZGdldCk7CiAKICAgICAgIHgtPnRv b2xiYXJfd2lkZ2V0ID0gMDsKICAgICAgIHgtPnRvb2xiYXJfd2lkZ2V0ID0gMDsKQEAgLTUwMDcs MTQgKzUwMDcsMTQgQEAgZnJlZV9mcmFtZV90b29sX2JhciAoc3RydWN0IGZyYW1lICpmKQogICAg ICAgRlJBTUVfVE9PTEJBUl9MRUZUX1dJRFRIIChmKSA9IEZSQU1FX1RPT0xCQVJfUklHSFRfV0lE VEggKGYpID0gMDsKIAogICAgICAgdGJpbmZvID0gZ19vYmplY3RfZ2V0X2RhdGEgKEdfT0JKRUNU IChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSksCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgVEJfSU5GT19LRVkpOworCQkJCSAgVEJfSU5GT19LRVkpOwogICAgICAgaWYgKHRi aW5mbykKLSAgICAgICAgewotICAgICAgICAgIHhmcmVlICh0YmluZm8pOwotICAgICAgICAgIGdf b2JqZWN0X3NldF9kYXRhIChHX09CSkVDVCAoRlJBTUVfR1RLX09VVEVSX1dJREdFVCAoZikpLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBUQl9JTkZPX0tFWSwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgTlVMTCk7Ci0gICAgICAgIH0KKwl7CisJICB4ZnJlZSAodGJpbmZvKTsK KwkgIGdfb2JqZWN0X3NldF9kYXRhIChHX09CSkVDVCAoRlJBTUVfR1RLX09VVEVSX1dJREdFVCAo ZikpLAorCQkJICAgICBUQl9JTkZPX0tFWSwKKwkJCSAgICAgTlVMTCk7CisJfQogCiAgICAgICBm cmFtZV9zaXplX2hpc3RvcnlfYWRkIChmLCBRZnJlZV9mcmFtZV90b29sX2JhciwgMCwgMCwgUW5p bCk7CiAgICAgICBhZGp1c3RfZnJhbWVfc2l6ZSAoZiwgLTEsIC0xLCAyLCAwLCBRdG9vbF9iYXJf bGluZXMpOwpAQCAtNTAzNywxMSArNTAzNywxMSBAQCB4Z19jaGFuZ2VfdG9vbGJhcl9wb3NpdGlv biAoc3RydWN0IGZyYW1lICpmLCBMaXNwX09iamVjdCBwb3MpCiAgIGlmICh4LT50b29sYmFyX2lz X3BhY2tlZCkKICAgICB7CiAgICAgICBpZiAoeC0+dG9vbGJhcl9pbl9oYm94KQotICAgICAgICBn dGtfY29udGFpbmVyX3JlbW92ZSAoR1RLX0NPTlRBSU5FUiAoeC0+aGJveF93aWRnZXQpLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9wX3dpZGdldCk7CisJZ3RrX2NvbnRhaW5lcl9y ZW1vdmUgKEdUS19DT05UQUlORVIgKHgtPmhib3hfd2lkZ2V0KSwKKwkJCSAgICAgIHRvcF93aWRn ZXQpOwogICAgICAgZWxzZQotICAgICAgICBndGtfY29udGFpbmVyX3JlbW92ZSAoR1RLX0NPTlRB SU5FUiAoeC0+dmJveF93aWRnZXQpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9w X3dpZGdldCk7CisJZ3RrX2NvbnRhaW5lcl9yZW1vdmUgKEdUS19DT05UQUlORVIgKHgtPnZib3hf d2lkZ2V0KSwKKwkJCSAgICAgIHRvcF93aWRnZXQpOwogICAgIH0KIAogICB4Z19wYWNrX3Rvb2xf YmFyIChmLCBwb3MpOwpAQCAtNTA2MCw3ICs1MDYwLDcgQEAgeGdfY2hhbmdlX3Rvb2xiYXJfcG9z aXRpb24gKHN0cnVjdCBmcmFtZSAqZiwgTGlzcF9PYmplY3QgcG9zKQogCiAMCiAvKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioKLSAgICAgICAgICAgICAgICAgICAgICBJbml0aWFsaXppbmcKKwkJICAgICAgSW5pdGlh bGl6aW5nCiAqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKi8KIHZvaWQKIHhnX2luaXRpYWxpemUgKHZvaWQpCkBAIC01 MDgzLDMzICs1MDgzLDMzIEBAIHhnX2luaXRpYWxpemUgKHZvaWQpCiAgIGlkX3RvX3dpZGdldC53 aWRnZXRzID0gMDsKIAogICBzZXR0aW5ncyA9IGd0a19zZXR0aW5nc19nZXRfZm9yX3NjcmVlbiAo Z2RrX2Rpc3BsYXlfZ2V0X2RlZmF1bHRfc2NyZWVuCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAoZ2RrX2Rpc3BsYXlfZ2V0X2RlZmF1bHQgKCkpKTsKKwkJCQkJICAo Z2RrX2Rpc3BsYXlfZ2V0X2RlZmF1bHQgKCkpKTsKICAgLyogUmVtb3ZlIEYxMCBhcyBhIG1lbnUg YWNjZWxlcmF0b3IsIGl0IGRvZXMgbm90IG1peCB3ZWxsIHdpdGggRW1hY3Mga2V5CiAgICAgIGJp bmRpbmdzLiAgSXQgZG9lc24ndCBzZWVtIHRvIGJlIGFueSB3YXkgdG8gcmVtb3ZlIHByb3BlcnRp ZXMsCiAgICAgIHNvIHdlIHNldCBpdCB0byAiIiB3aGljaCBpbiBtZWFucyAibm8ga2V5Ii4gICov CiAgIGd0a19zZXR0aW5nc19zZXRfc3RyaW5nX3Byb3BlcnR5IChzZXR0aW5ncywKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICJndGstbWVudS1iYXItYWNjZWwiLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIiIsCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBFTUFDU19DTEFTUyk7CisJCQkJICAgICJndGstbWVudS1iYXItYWNjZWwi LAorCQkJCSAgICAiIiwKKwkJCQkgICAgRU1BQ1NfQ0xBU1MpOwogCiAgIC8qIE1ha2UgR1RLIHRl eHQgaW5wdXQgd2lkZ2V0cyB1c2UgRW1hY3Mgc3R5bGUga2V5YmluZGluZ3MuICBUaGlzIGlzCiAg ICAgIEVtYWNzIGFmdGVyIGFsbC4gICovCiAgIGd0a19zZXR0aW5nc19zZXRfc3RyaW5nX3Byb3Bl cnR5IChzZXR0aW5ncywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJndGst a2V5LXRoZW1lLW5hbWUiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIkVt YWNzIiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEVNQUNTX0NMQVNTKTsK KwkJCQkgICAgImd0ay1rZXktdGhlbWUtbmFtZSIsCisJCQkJICAgICJFbWFjcyIsCisJCQkJICAg IEVNQUNTX0NMQVNTKTsKIAogICAvKiBNYWtlIGRpYWxvZ3MgY2xvc2Ugb24gQy1nLiAgU2luY2Ug ZmlsZSBkaWFsb2cgaW5oZXJpdHMgZnJvbQogICAgICBkaWFsb2csIHRoaXMgd29ya3MgZm9yIHRo ZW0gYWxzby4gICovCiAgIGJpbmRpbmdfc2V0ID0gZ3RrX2JpbmRpbmdfc2V0X2J5X2NsYXNzIChn X3R5cGVfY2xhc3NfcmVmIChHVEtfVFlQRV9ESUFMT0cpKTsKICAgZ3RrX2JpbmRpbmdfZW50cnlf YWRkX3NpZ25hbCAoYmluZGluZ19zZXQsIEdES19LRVlfZywgR0RLX0NPTlRST0xfTUFTSywKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgImNsb3NlIiwgMCk7CisJCQkJImNsb3NlIiwg MCk7CiAKICAgLyogTWFrZSBtZW51cyBjbG9zZSBvbiBDLWcuICAqLwogICBiaW5kaW5nX3NldCA9 IGd0a19iaW5kaW5nX3NldF9ieV9jbGFzcyAoZ190eXBlX2NsYXNzX3JlZgotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKEdUS19UWVBFX01FTlVfU0hFTEwpKTsKKwkJ CQkJICAoR1RLX1RZUEVfTUVOVV9TSEVMTCkpOwogICBndGtfYmluZGluZ19lbnRyeV9hZGRfc2ln bmFsIChiaW5kaW5nX3NldCwgR0RLX0tFWV9nLCBHREtfQ09OVFJPTF9NQVNLLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAiY2FuY2VsIiwgMCk7CisJCQkJImNhbmNlbCIsIDApOwog ICB1cGRhdGVfdGhlbWVfc2Nyb2xsYmFyX3dpZHRoICgpOwogICB1cGRhdGVfdGhlbWVfc2Nyb2xs YmFyX2hlaWdodCAoKTsKIApkaWZmIC0tZ2l0IGEvc3JjL2d0a3V0aWwuaCBiL3NyYy9ndGt1dGls LmgKaW5kZXggODg0MGZlNy4uYTE2MTg4ZiAxMDA2NDQKLS0tIGEvc3JjL2d0a3V0aWwuaAorKysg Yi9zcmMvZ3RrdXRpbC5oCkBAIC04MCwyOCArODAsMjggQEAgdHlwZWRlZiBzdHJ1Y3QgeGdfbWVu dV9pdGVtX2NiX2RhdGFfCiBleHRlcm4gYm9vbCB4Z191c2VzX29sZF9maWxlX2RpYWxvZyAodm9p ZCk7CiAKIGV4dGVybiBjaGFyICp4Z19nZXRfZmlsZV9uYW1lIChzdHJ1Y3QgZnJhbWUgKmYsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY2hhciAqcHJvbXB0LAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNoYXIgKmRlZmF1bHRfZmlsZW5hbWUsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgYm9vbCBtdXN0bWF0Y2hfcCwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBib29sIG9ubHlfZGlyX3ApOworCQkJICAgICAgIGNoYXIgKnByb21wdCwKKwkJ CSAgICAgICBjaGFyICpkZWZhdWx0X2ZpbGVuYW1lLAorCQkJICAgICAgIGJvb2wgbXVzdG1hdGNo X3AsCisJCQkgICAgICAgYm9vbCBvbmx5X2Rpcl9wKTsKIAogZXh0ZXJuIExpc3BfT2JqZWN0IHhn X2dldF9mb250IChzdHJ1Y3QgZnJhbWUgKmYsIGNvbnN0IGNoYXIgKik7CiAKIGV4dGVybiBHdGtX aWRnZXQgKnhnX2NyZWF0ZV93aWRnZXQgKGNvbnN0IGNoYXIgKnR5cGUsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpuYW1lLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgc3RydWN0IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgc3RydWN0IF93aWRnZXRfdmFsdWUgKnZhbCwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIEdDYWxsYmFjayBzZWxlY3RfY2IsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICBHQ2FsbGJhY2sgZGVhY3RpdmF0ZV9jYiwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdDYWxsYmFjayBoaWdobGlnaHRfY2IpOwor CQkJCSAgICBjb25zdCBjaGFyICpuYW1lLAorCQkJCSAgICBzdHJ1Y3QgZnJhbWUgKmYsCisJCQkJ ICAgIHN0cnVjdCBfd2lkZ2V0X3ZhbHVlICp2YWwsCisJCQkJICAgIEdDYWxsYmFjayBzZWxlY3Rf Y2IsCisJCQkJICAgIEdDYWxsYmFjayBkZWFjdGl2YXRlX2NiLAorCQkJCSAgICBHQ2FsbGJhY2sg aGlnaGxpZ2h0X2NiKTsKIAogZXh0ZXJuIHZvaWQgeGdfbW9kaWZ5X21lbnViYXJfd2lkZ2V0cyAo R3RrV2lkZ2V0ICptZW51YmFyLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IF93aWRnZXRfdmFsdWUgKnZhbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGJvb2wgZGVlcF9wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgR0NhbGxiYWNrIHNlbGVjdF9jYiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIEdDYWxsYmFjayBkZWFjdGl2YXRlX2NiLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgR0NhbGxiYWNrIGhpZ2hsaWdodF9jYik7CisJCQkJICAgICAg IHN0cnVjdCBmcmFtZSAqZiwKKwkJCQkgICAgICAgc3RydWN0IF93aWRnZXRfdmFsdWUgKnZhbCwK KwkJCQkgICAgICAgYm9vbCBkZWVwX3AsCisJCQkJICAgICAgIEdDYWxsYmFjayBzZWxlY3RfY2Is CisJCQkJICAgICAgIEdDYWxsYmFjayBkZWFjdGl2YXRlX2NiLAorCQkJCSAgICAgICBHQ2FsbGJh Y2sgaGlnaGxpZ2h0X2NiKTsKIAogZXh0ZXJuIHZvaWQgeGdfdXBkYXRlX2ZyYW1lX21lbnViYXIg KHN0cnVjdCBmcmFtZSAqZik7CiAKQEAgLTExMCwxMCArMTEwLDEwIEBAIGV4dGVybiBib29sIHhn X2V2ZW50X2lzX2Zvcl9tZW51YmFyIChzdHJ1Y3QgZnJhb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HNjcm9sbGJhcl9p ZCk7CiAKIGV4dGVybiB2b2lkIHhnX3VwZGF0ZV9zY3JvbGxiYXJfcG9zIChzdHJ1Y3QgZnJhbWUg KmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHRyZGlmZl90IHNjcm9s bGJhcl9pZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQgdG9wLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBsZWZ0LAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCB3aWR0aCwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBpbnQgaGVpZ2h0KTsKKwkJCQkgICAgIHB0cmRpZmZfdCBzY3Jv bGxiYXJfaWQsCisJCQkJICAgICBpbnQgdG9wLAorCQkJCSAgICAgaW50IGxlZnQsCisJCQkJICAg ICBpbnQgd2lkdGgsCisJCQkJICAgICBpbnQgaGVpZ2h0KTsKIGV4dGVybiB2b2lkIHhnX3VwZGF0 ZV9ob3Jpem9udGFsX3Njcm9sbGJhcl9wb3MgKHN0cnVjdCBmcmFtZSAqZiwKIAkJCQkJCXB0cmRp ZmZfdCBzY3JvbGxiYXJfaWQsCiAJCQkJCQlpbnQgdG9wLApAQCAtMTM1LDkgKzEzNSw5IEBAIGV4 dGVybiB2b2lkIHhnX3VwZGF0ZV9ob3Jpem9udGFsX3Njcm9sbGJhcl9wb3MgKHN0cnVjdCBmcmFt ZSAqZiwKIAkJCQkJCWludCBoZWlnaHQpOwogCiBleHRlcm4gdm9pZCB4Z19zZXRfdG9vbGtpdF9z Y3JvbGxfYmFyX3RodW1iIChzdHJ1Y3Qgc2Nyb2xsX2JhciAqYmFyLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IHBvcnRpb24sCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQ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cmZhY2UgKHN0cnVjdCBpbWFnZSAqaW1nLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgIHVuc2lnbmVkIGNoYXIgKmRhdGEsCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgaW50IHdpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBoZWlnaHQpCisJ CQkgICAgdW5zaWduZWQgY2hhciAqZGF0YSwKKwkJCSAgICBpbnQgd2lkdGgsCisJCQkgICAgaW50 IGhlaWdodCkKIHsKICAgY2Fpcm9fc3VyZmFjZV90ICpzdXJmYWNlOwogICBjYWlyb19mb3JtYXRf dCBmb3JtYXQgPSBDQUlST19GT1JNQVRfQVJHQjMyOwogICBpbnQgc3RyaWRlID0gY2Fpcm9fZm9y bWF0X3N0cmlkZV9mb3Jfd2lkdGggKGZvcm1hdCwgd2lkdGgpOwogICBzdXJmYWNlID0gY2Fpcm9f aW1hZ2Vfc3VyZmFjZV9jcmVhdGVfZm9yX2RhdGEgKGRhdGEsCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZm9ybWF0LAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHdpZHRoLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGhlaWdodCwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJpZGUpOworCQkJCQkJIGZvcm1hdCwK KwkJCQkJCSB3aWR0aCwKKwkJCQkJCSBoZWlnaHQsCisJCQkJCQkgc3RyaWRlKTsKICAgaW1nLT53 aWR0aCA9IHdpZHRoOwogICBpbWctPmhlaWdodCA9IGhlaWdodDsKICAgaW1nLT5jcl9kYXRhID0g c3VyZmFjZTsKQEAgLTI3NDMsNyArMjc0Myw3IEBAIENyZWF0ZV9QaXhtYXBfRnJvbV9CaXRtYXBf RGF0YSAoc3RydWN0IGZyY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TM3MzUsMTggKzM3MzUsMTggQEAgeHBtX2xvYWQgKHN0cnVjdCBmcmFtZSAqZiwgc3RydWN0 IGltYWdlICppbWcpCiAgICAgICB1aW50MzJfdCBiZ2NvbG9yID0gZ2V0X3NwZWNfYmdfb3JfYWxw aGFfYXNfYXJnYiAoaW1nLCBmKTsKIAogICAgICAgZm9yIChpID0gMDsgaSA8IGhlaWdodDsgKytp KQotICAgICAgICB7Ci0gICAgICAgICAgaW50IGs7Ci0gICAgICAgICAgZm9yIChrID0gMDsgayA8 IHdpZHRoOyArK2spCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGludCBpZHggPSBpICog aW1nLT54aW1nLT5ieXRlc19wZXJfbGluZS80ICsgazsKLSAgICAgICAgICAgICAgaW50IG1hc2tp ZHggPSBtaWQgPyBpICogaW1nLT5tYXNrX2ltZy0+Ynl0ZXNfcGVyX2xpbmUgKyBrLzggOiAwOwot ICAgICAgICAgICAgICBpbnQgbWFzayA9IG1pZCA/IG1pZFttYXNraWR4XSAmICgxIDw8IChrICUg OCkpIDogMTsKLQotICAgICAgICAgICAgICBpZiAobWFzaykgb2RbaWR4XSA9IGlkW2lkeF0gKyAw eGZmMDAwMDAwOyAvKiBmZiA9PiBmdWxsIGFscGhhICovCi0gICAgICAgICAgICAgIGVsc2Ugb2Rb aWR4XSA9IGJnY29sb3I7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJICBpbnQgazsK KwkgIGZvciAoayA9IDA7IGsgPCB3aWR0aDsgKytrKQorCSAgICB7CisJICAgICAgaW50IGlkeCA9 IGkgKiBpbWctPnhpbWctPmJ5dGVzX3Blcl9saW5lLzQgKyBrOworCSAgICAgIGludCBtYXNraWR4 ID0gbWlkID8gaSAqIGltZy0+bWFza19pbWctPmJ5dGVzX3Blcl9saW5lICsgay84IDogMDsKKwkg ICAgICBpbnQgbWFzayA9IG1pZCA/IG1pZFttYXNraWR4XSAmICgxIDw8IChrICUgOCkpIDogMTsK KworCS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lzcF9PYmplY3QpOwogc3RhdGljIExpc3BfT2JqZWN0IHhw bV9nZXRfY29sb3JfdGFibGVfdiAoTGlzcF9PYmplY3QsIGNvbnN0IGNoYXIgKiwgaW50KTsKIHN0 YXRpYyB2b2lkIHhwbV9wdXRfY29sb3JfdGFibGVfaCAoTGlzcF9PYmplY3QsIGNvbnN0IGNoYXIg KiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBMaXNwX09iamVjdCk7 CisJCQkJICAgaW50LCBMaXNwX09iamVjdCk7CiBzdGF0aWMgTGlzcF9PYmplY3QgeHBtX2dldF9j b2xvcl90YWJsZV9oIChMaXNwX09iamVjdCwgY29uc3QgY2hhciAqLCBpbnQpOwogCiAvKiBUb2tl bnMgcmV0dXJuZWQgZnJvbSB4cG1fc2Nhbi4gICovCkBAIC0zOTgxLDkgKzM5ODEsOSBAQCB4cG1f c2NhbiAoY29uc3QgY2hhciAqKnMsIGNvbnN0IGNoYXIgKmVuZCwgY29uc3QgY2hhciAqKmJlZywg cHRyZGlmZl90ICpsZW4pCiAKIHN0YXRpYyBMaXNwX09iamVjdAogeHBtX21ha2VfY29sb3JfdGFi bGVfdiAodm9pZCAoKipwdXRfZnVuYykgKExpc3BfT2JqZWN0LCBjb25zdCBjaGFyICosIGludCwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCks Ci0gICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCAoKipnZXRfZnVuYykgKExpc3Bf T2JqZWN0LCBjb25zdCBjaGFyICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIGludCkpCisJCQkJCSAgIExpc3BfT2JqZWN0KSwKKwkJCUxpc3BfT2Jq ZWN0ICgqKmdldF9mdW5jKSAoTGlzcF9PYmplY3QsIGNvbnN0IGNoYXIgKiwKKwkJCQkJCSAgaW50 KSkKIHsKICAgKnB1dF9mdW5jID0geHBtX3B1dF9jb2xvcl90YWJsZV92OwogICAqZ2V0X2Z1bmMg PSB4cG1fZ2V0X2NvbG9yX3RhYmxlX3Y7CkBAIC0zOTkyLDkgKzM5OTIsOSBAQCB4cG1fbWFrZV9j b2xvcl90YWJsZV92ICh2b2lkICgqKnB1dF9mdW5jKSAoTGlzcF9PYmplY3QsIGNvbnN0IGNoYXIg KiwgaW50LAogCiBzdGF0aWMgdm9pZAogeHBtX3B1dF9jb2xvcl90YWJsZV92IChMaXNwX09iamVj dCBjb2xvcl90YWJsZSwKLSAgICAgICAgICAgICAgICAgICAgICAgY29uc3QgY2hhciAqY2hhcnNf c3RhcnQsCi0gICAgICAgICAgICAgICAgICAgICAgIGludCBjaGFyc19sZW4sCi0gICAgICAgICAg ICAgICAgICAgICAgIExpc3BfT2JqZWN0IGNvbG9yKQorCQkgICAgICAgY29uc3QgY2hhciAqY2hh cnNfc3RhcnQsCisJCSAgICAgICBpbnQgY2hhcnNfbGVuLAorCQkgICAgICAgTGlzcF9PYmplY3Qg Y29sb3IpCiB7CiAgIHVuc2lnbmVkIGNoYXIgdWMgPSAqY2hhcnNfc3RhcnQ7CiAgIEFTRVQgKGNv bG9yX3RhYmxlLCB1YywgY29sb3IpOwpAQCAtNDAwMiw4ICs0MDAyLDggQEAgeHBtX3B1dF9jb2xv cl90YWJsZV92IChMaXNwX09iamVjdCBjb2xvcl90YWJsZSwKIAogc3RhdGljIExpc3BfT2JqZWN0 CiB4cG1fZ2V0X2NvbG9yX3RhYmxlX3YgKExpc3BfT2JqZWN0IGNvbG9yX3RhYmxlLAotICAgICAg ICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpjaGFyc19zdGFydCwKLSAgICAgICAgICAgICAg ICAgICAgICAgaW50IGNoYXJzX2xlbikKKwkJICAgICAgIGNvbnN0IGNoYXIgKmNoYXJzX3N0YXJ0 LAorCQkgICAgICAgaW50IGNoYXJzX2xlbikKIHsKICAgdW5zaWduZWQgY2hhciB1YyA9ICpjaGFy c19zdGFydDsKICAgcmV0dXJuIEFSRUYgKGNvbG9yX3RhYmxlLCB1Yyk7CkBAIC00MDExLDkgKzQw MTEsOSBAQCB4cG1fZ2V0X2NvbG9yX3RhYmxlX3YgKExpc3BfT2JqZWN0IGNvbG9yX3RhYmxlLAog CiBzdGF0aWMgTGlzcF9PYmplY3QKIHhwbV9tYWtlX2NvbG9yX3RhYmxlX2ggKHZvaWQgKCoqcHV0 X2Z1bmMpIChMaXNwX09iamVjdCwgY29uc3QgY2hhciAqLCBpbnQsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QpLAotICAgICAgICAgICAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgKCoqZ2V0X2Z1bmMpIChMaXNwX09iamVjdCwgY29uc3QgY2hh ciAqLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBp bnQpKQorCQkJCQkgICBMaXNwX09iamVjdCksCisJCQlMaXNwX09iamVjdCAoKipnZXRfZnVuYykg KExpc3BfT2JqZWN0LCBjb25zdCBjaGFyICosCisJCQkJCQkgIGludCkpCiB7CiAgICpwdXRfZnVu YyA9IHhwbV9wdXRfY29sb3JfdGFibGVfaDsKICAgKmdldF9mdW5jID0geHBtX2dldF9jb2xvcl90 YWJsZV9oOwpAQCAtNDAyNSw5ICs0MDI1LDkgQEAgeHBtX21ha2VfY29sb3JfdGFibGVfaCAodm9p ZCAoKipwdXRfZnVuYykgKExpc3BfT2JqZWN0LCBjb25zdCBjaGFyICosIGludCwKIAogc3RhdGlj IHZvaWQKIHhwbV9wdXRfY29sb3JfdGFibGVfaCAoTGlzcF9PYmplY3QgY29sb3JfdGFibGUsCi0g ICAgICAgICAgICAgICAgICAgICAgIGNvbnN0IGNoYXIgKmNoYXJzX3N0YXJ0LAotICAgICAgICAg ICAgICAgICAgICAgICBpbnQgY2hhcnNfbGVuLAotICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBjb2xvcikKKwkJICAgICAgIGNvbnN0IGNoYXIgKmNoYXJzX3N0YXJ0LAorCQkgICAg ICAgaW50IGNoYXJzX2xlbiwKKwkJICAgICAgIExpc3BfT2JqZWN0IGNvbG9yKQogewogICBzdHJ1 Y3QgTGlzcF9IYXNoX1RhYmxlICp0YWJsZSA9IFhIQVNIX1RBQkxFIChjb2xvcl90YWJsZSk7CiAg IEVNQUNTX1VJTlQgaGFzaF9jb2RlOwpAQCAtNDAzOSw4ICs0MDM5LDggQEAgeHBtX3B1dF9jb2xv cl90YWJsZV9oIChMaXNwX09iamVjdCBjb2xvcl90YWJsZSwKIAogc3RhdGljIExpc3BfT2JqZWN0 CiB4cG1fZ2V0X2NvbG9yX3RhYmxlX2ggKExpc3BfT2JqZWN0IGNvbG9yX3RhYmxlLAotICAgICAg ICAgICAgICAgICAgICAgICBjb25zdCBjaGFyICpjaGFyc19zdGFydCwKLSAgICAgICAgICAgICAg ICAgICAgICAgaW50IGNoYXJzX2xlbikKKwkJICAgICAgIGNvbnN0IGNoYXIgKmNoYXJzX3N0YXJ0 LAorCQkgICAgICAgaW50IGNoYXJzX2xlbikKIHsKICAgc3RydWN0IExpc3BfSGFzaF9UYWJsZSAq dGFibGUgPSBYSEFTSF9UQUJMRSAoY29sb3JfdGFibGUpOwogICBwdHJkaWZmX3QgaSA9CkBAIC00 MDcyLDkgKzQwNzIsOSBAQCB4cG1fc3RyX3RvX2NvbG9yX2tleSAoY29uc3QgY2hhciAqcykKIAog c3RhdGljIGJvb2wKIHhwbV9sb2FkX2ltYWdlIChzdHJ1Y3QgZnJhbWUgKmYsCi0gICAgICAgICAg ICAgICAgc3RydWN0IGltYWdlICppbWcsCi0gICAgICAgICAgICAgICAgY29uc3QgY2hhciAqY29u dGVudHMsCi0gICAgICAgICAgICAgICAgY29uc3QgY2hhciAqZW5kKQorCQlzdHJ1Y3QgaW1hZ2Ug KmltZywKKwkJY29uc3QgY2hhciAqY29udGVudHMsCisJCW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sCiB4cG1fbG9hZCAoc3RydWN0IGZyYW1lICpmLAotICAgICAgICAgIHN0cnVjdCBpbWFnZSAq aW1nKQorCSAgc3RydWN0IGltYWdlICppbWcpCiB7CiAgIGJvb2wgc3VjY2Vzc19wID0gMDsKICAg TGlzcF9PYmplY3QgZmlsZV9uYW1lOwpAQCAtNDYzOSwxNiArNDYzOSwxNiBAQCBpbml0X2NvbG9y X3RhYmxlICh2b2lkKQogCiBzdGF0aWMgaW50IGVtYm9zc19tYXRyaXhbOV0gPSB7CiAgICAvKiB4 IC0gMQl4CXggKyAxICAqLwotICAgICAgICAyLCAgICAgLTEsICAJICAwLAkJLyogeSAtIDEgKi8K KwkyLCAgICAgLTEsICAJICAwLAkJLyogeSAtIDEgKi8KICAgICAgICAtMSwgICAgICAwLCAgICAg ICAgMSwJCS8qIHkgICAgICovCi0gICAgICAgIDAsICAgICAgMSwgICAgICAgLTIJCS8qIHkgKyAx ICovCisJMCwgICAgICAxLCAgICAgICAtMgkJLyogeSArIDEgKi8KIH07CiAKIHN0YXRpYyBpbnQg bGFwbGFjZV9tYXRyaXhbOV0gPSB7CiAgICAvKiB4IC0gMQl4CXggKyAxICAqLwotICAgICAgICAx LCAgICAgIDAsICAJICAwLAkJLyogeSAtIDEgKi8KLSAgICAgICAgMCwgICAgICAwLCAgICAgICAg MCwJCS8qIHkgICAgICovCi0gICAgICAgIDAsICAgICAgMCwgICAgICAgLTEJCS8qIHkgKyAxICov CisJMSwgICAgICAwLCAgCSAgMCwJCS8qIHkgLSAxICovCisJMCwgICAgICAwLCAgICAgICAgMCwJ CS8qIHkgICAgICovCisJMCwgICAgICAwLCAgICAgICAtMQkJLyogeSArIDEgKi8KIH07CiAKIC8q IFZhbHVlIGlzIHRoZSBpbnRlbnNpdHkgb2YgdGhlIGNvbG9yIHdob3NlIHJlZC9ncmVlbi9ibHVl IHZhbHVlcwpAQCAtNDg1MSw4ICs0ODUxLDggQEAgeF9kZXRlY3RfZWRnZXMgKHN0cnVjdCB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2xvcm1hcFtpZ11baV07CisJICAgIGIgPSBtZ3It PmNpbmZvLmNvbG9ybWFwW2liXVtpXTsKKwkgICAgKmRhdGFwdHIrKyA9ICgweGZmdSA8PCAyNCkg fCAociA8PCAxNikgfCAoZyA8PCA4KSB8IGI7CisJICB9CiAgICAgICB9CiAKICAgICBjcmVhdGVf Y2Fpcm9faW1hZ2Vfc3VyZmFjZSAoaW1nLCBkYXRhLCB3aWR0aCwgaGVpZ2h0KTsKQEAgLTczMDcs MTYgKzczMDcsMTYgQEAgdGlmZl9sb2FkIChzdHJ1Y3QgZnJhbWUgKmYsIHN0cnVjdCBpbWFnZSAq aW1nKQogCiAgICAgZm9yICh5ID0gMDsgeSA8IGhlaWdodDsgKyt5KQogICAgICAgewotICAgICAg ICB1aW50MzIgKnJvdyA9IGJ1ZiArIChoZWlnaHQgLSAxIC0geSkgKiB3aWR0aDsKLSAgICAgICAg Zm9yICh4ID0gMDsgeCA8IHdpZHRoOyArK3gpCi0gICAgICAgICAgewotICAgICAgICAgICAgdWlu dDMyIGFiZ3IgPSByb3dbeF07Ci0gICAgICAgICAgICBpbnQgciA9IFRJRkZHZXRSIChhYmdyKTsK LSAgICAgICAgICAgIGludCBnID0gVElGRkdldEcgKGFiZ3IpOwotICAgICAgICAgICAgaW50IGIg PSBUSUZGR2V0QiAoYWJncik7Ci0gICAgICAgICAgICBpbnQgYSA9IFRJRkZHZXRBIChhYmdyKTsK LSAgICAgICAgICAgICpkYXRhcHRyKysgPSAoYSA8PCAyNCkgfCAociA8PCAxNikgfCAoZyA8PCA4 KSB8IGI7Ci0gICAgICAgICAgfQorCXVpbnQzMiAqcm93ID0gYnVmICsgKGhlaWdodCAtIDEgLSB5 KSAqIHdpZHRoOworCWZvciAoeCA9IDA7IHggPCB3aWR0aDsgKyt4KQorCSAgeworCSAgICB1aW50 MzIgYWJnciA9IHJvd1t4XTsKKwkgICAgaW50IHIgPSBUSUZGR2V0UiAoYWJncik7CisJICAgIGlu dCBnID0gVElGR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ICAgICAgICAgICAgICAgICAgICAoZGF0YTMyICsgKChyb3cgKyBzdWJpbWdfdG9wKSAqIHN1Ymlt Z193aWR0aAorCQkgICAgICB1aW50MzJfdCAqZGF0YXB0ciA9CisJCQkoZGF0YTMyICsgKChyb3cg KyBzdWJpbWdfdG9wKSAqIHN1YmltZ193aWR0aAogCQkJCSAgICsgeCArIHN1YmltZ19sZWZ0KSk7 Ci0gICAgICAgICAgICAgICAgICAgICAgaW50IHIgPSBnaWZfY29sb3JfbWFwLT5Db2xvcnNbY10u UmVkOwotICAgICAgICAgICAgICAgICAgICAgIGludCBnID0gZ2lmX2NvbG9yX21hcC0+Q29sb3Jz W2NdLkdyZWVuOwotICAgICAgICAgICAgICAgICAgICAgIGludCBiID0gZ2lmX2NvbG9yX21hcC0+ Q29sb3JzW2NdLkJsdWU7CisJCSAgICAgIGludCByID0gZ2lmX2NvbG9yX21hcC0+Q29sb3JzW2Nd LlJlZDsKKwkJICAgICAgaW50IGcgPSBnaWZfY29sb3JfbWFwLT5Db2xvcnNbY10uR3JlZW47CisJ CSAgICAgIGludCBiID0gZ2lmX2NvbG9yX21hcC0+Q29sb3JzW2NdLkJsdWU7CiAKLSAgICAgICAg ICAgICAgICAgICAgICBpZiAodHJhbnNwYXJlbmN5X2NvbG9yX2luZGV4ICE9IGMpCi0gICAgICAg ICAgICAgICAgICAgICAgICAqZGF0YXB0ciA9ICgweGZmdSA8PCAyNCkgfCAociA8PCAxNikgfCAo ZyA8PCA4KSB8IGI7CisJCSAgICAgIGlmICh0cmFuc3BhcmVuY3lfY29sb3JfaW5kZXggIT0gYykK KwkJCSpkYXRhcHRyID0gKDB4ZmZ1IDw8IDI0KSB8IChyIDw8IDE2KSB8IChnIDw8IDgpIHwgYjsK ICNlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgWFB1dFBpeGVsICh4aW1nLCB4ICsgc3ViaW1n X2xlZnQsIHJvdyArIHN1YmltZ190b3AsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBwaXhlbF9jb2xvcnNbY10pOworCQkgICAgICBYUHV0UGl4ZWwgKHhpbWcsIHggKyBzdWJpbWdf bGVmdCwgcm93ICsgc3ViaW1nX3RvcCwKKwkJCQkgcGl4ZWxfY29sb3JzW2NdKTsKICNlbmRpZgot ICAgICAgICAgICAgICAgICAgICB9CisJCSAgICB9CiAJCX0KIAkgICAgfQogCX0KICAgICAgIGVs c2UKIAl7Ci0gICAgICAgICAgZm9yICh5ID0gMDsgeSA8IHN1YmltZ19oZWlnaHQ7ICsreSkKKwkg IGZvciAoeSA9IDA7IHkgPCBzdWJpbWdfaGVpZ2h0OyArK3kpCiAJICAgIGZvciAoeCA9IDA7IHgg PCBzdWJpbWdfd2lkdGg7ICsreCkKIAkgICAgICB7CiAJCWludCBjID0gcmFzdGVyW3kgKiBzdWJp bWdfd2lkdGggKyB4XTsKIAkJaWYgKHRyYW5zcGFyZW5jeV9jb2xvcl9pbmRleCAhPSBjIHx8IGRp c3Bvc2FsICE9IDEpCi0gICAgICAgICAgICAgICAgICB7CisJCSAgewogI2lmZGVmIFVTRV9DQUlS TwotICAgICAgICAgICAgICAgICAgICB1aW50MzJfdCAqZGF0YXB0ciA9Ci0gICAgICAgICAgICAg ICAgICAgICAgKGRhdGEzMiArICgoeSArIHN1YmltZ190b3ApICogc3ViaW1nX3dpZHRoCisJCSAg ICB1aW50MzJfdCAqZGF0YXB0ciA9CisJCSAgICAgIChkYXRhMzIgKyAoKHkgKyBzdWJpbWdfdG9w KSAqIHN1YmltZ193aWR0aAogCQkJCSArIHggKyBzdWJpbWdfbGVmdCkpOwotICAgICAgICAgICAg ICAgICAgICBpbnQgciA9IGdpZl9jb2xvcl9tYXAtPkNvbG9yc1tjXS5SZWQ7Ci0gICAgICAgICAg ICAgICAgICAgIGludCBnID0gZ2lmX2NvbG9yX21hcC0+Q29sb3JzW2NdLkdyZWVuOwotICAgICAg ICAgICAgICAgICAgICBpbnQgYiA9IGdpZl9jb2xvcl9tYXAtPkNvbG9yc1tjXS5CbHVlOwotICAg ICAgICAgICAgICAgICAgICBpZiAodHJhbnNwYXJlbmN5X2NvbG9yX2luZGV4ICE9IGMpCi0gICAg ICAgICAgICAgICAgICAgICAgKmRhdGFwdHIgPSAoMHhmZnUgPDwgMjQpIHwgKHIgPDwgMTYpIHwg KGcgPDwgOCkgfCBiOworCQkgICAgaW50IHIgPSBnaWZfY29sb3JfbWFwLT5Db2xvcnNbY10uUmVk OworCQkgICAgaW50IGcgPSBnaWZfY29sb3JfbWFwLT5Db2xvcnNbY10uR3JlZW47CisJCSAgICBp bnQgYiA9IGdpZl9jb2xvcl9tYXAtPkNvbG9yc1tjXS5CbHVlOworCQkgICAgaWYgKHRyYW5zcGFy ZW5jeV9jb2xvcl9pbmRleCAhPSBjKQorCQkgICAgICAqZGF0YXB0ciA9ICgweGZmdSA8PCAyNCkg fCAociA8PCAxNikgfCAoZyA8PCA4KSB8IGI7CiAjZWxzZQotICAgICAgICAgICAgICAgICAgICBY UHV0UGl4ZWwgKHhpbWcsIHggKyBzdWJpbWdfbGVmdCwgeSArIHN1YmltZ190b3AsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgcGl4ZWxfY29sb3JzW2NdKTsKKwkJICAgIFhQdXRQaXhl bCAoeGltZywgeCArIHN1YmltZ19sZWZ0LCB5ICsgc3ViaW1nX3RvcCwKKwkJCSAgICAgICBwaXhl bF9jb2xvcnNbY10pOwogI2VuZGlmCi0gICAgICAgICAgICAgICAgICB9CisJCSAgfQogCSAgICAg IH0KIAl9CiAgICAgfQpAQCAtODAyNCw3ICs4MDI0LDcgQEAgc3RhdGljIGJvb2wKIGdpZl9sb2Fk IChzdHJ1Y3QgZnJhbWUgKmYsIHN0cnVjdCBpbWFnZSAqaW1nKQogewogICByZXR1cm4gbnNfbG9h ZF9pbWFnZSAoZiwgaW1nLAotICAgICAgICAgICAgICAgICAgICAgICAgaW1hZ2Vfc3BlY192YWx1 ZSAoaW1nLT5zcGVjLCBRQ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ZGF0YSksIFNCWVRFUyAoZGF0YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg KE5JTFAgKG9yaWdpbmFsX2ZpbGVuYW1lKSA/IE5VTEwKKwkJCQkgIChOSUxQIChvcmlnaW5hbF9m aWxlbmFtZSkgPyBOVUxMCiAJCQkJICAgOiBTU0RBVEEgKG9yaWdpbmFsX2ZpbGVuYW1lKSkpOwog ICAgIH0KIApAQCAtOTI4MSwyMiArOTI4MSwyMiBAQCBzdmdfbG9hZF9pbWFnZSAoc3RydWN0IGZy YW1lICpmLCBzdHJ1Y3QgaW1hZ2UgKmltZywgY2hhciAqY29udGVudHMsCiAKICAgICBmb3IgKGlu dCB5ID0gMDsgeSA8IGhlaWdodDsgKyt5KQogICAgICAgewotICAgICAgICBjb25zdCBndWNoYXIg Kmljb25wdHIgPSBwaXhlbHMgKyB5ICogcm93c3RyaWRlOwotICAgICAgICB1aW50MzJfdCAqZGF0 YXB0ciA9ICh1aW50MzJfdCAqKSAoZGF0YSArIHkgKiByb3dzdHJpZGUpOwotCi0gICAgICAgIGZv ciAoaW50IHggPSAwOyB4IDwgd2lkdGg7ICsreCkKLSAgICAgICAgICB7Ci0gICAgICAgICAgICBp ZiAoaWNvbnB0clszXSA9PSAwKQotICAgICAgICAgICAgICAqZGF0YXB0ciA9IGJnY29sb3I7Ci0g ICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICpkYXRhcHRyID0gKGljb25wdHJbMF0gPDwg MTYpCi0gICAgICAgICAgICAgICAgfCAoaWNvbnB0clsxXSA8PCA4KQotICAgICAgICAgICAgICAg IHwgaWNvbnB0clsyXQotICAgICAgICAgICAgICAgIHwgKGljb25wdHJbM10gPDwgMjQpOwotCi0g ICAgICAgICAgICBpY29ucHRyICs9IDQ7Ci0gICAgICAgICAgICArK2RhdGFwdHI7Ci0gICAgICAg ICAgfQorCWNvbnN0IGd1Y2hhciAqaWNvbnB0ciA9IHBpeGVscyArIHkgKiByb3dzdHJpZGU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X3QgZnJvbWJ5dGUsIEVNQUNTX0lOVCBmcm9tdnBvcywKICAg ICAgIHdpZGVfY29sdW1uX2VuZF9ocG9zID0gMDsKIAogICAgICAgLyogQ29uc3VsdCB0aGUgd2lk dGggcnVuIGNhY2hlIHRvIHNlZSBpZiB3ZSBjYW4gYXZvaWQgaW5zcGVjdGluZwotICAgICAgICAg dGhlIHRleHQgY2hhcmFjdGVyLWJ5LWNoYXJhY3Rlci4gICovCisJIHRoZSB0ZXh0IGNoYXJhY3Rl ci1ieS1jaGFyYWN0ZXIuICAqLwogICAgICAgaWYgKHdpZHRoX2NhY2hlICYmIHBvcyA+PSBuZXh0 X3dpZHRoX3J1bikKLSAgICAgICAgewotICAgICAgICAgIHB0cmRpZmZfdCBydW5fZW5kOwotICAg ICAgICAgIGludCBjb21tb25fd2lkdGgKLSAgICAgICAgICAgID0gcmVnaW9uX2NhY2hlX2Zvcndh cmQgKGNhY2hlX2J1ZmZlciwgd2lkdGhfY2FjaGUsIHBvcywgJnJ1bl9lbmQpOwotCi0gICAgICAg ICAgLyogQSB3aWR0aCBvZiB6ZXJvIG1lYW5zIHRoZSBjaGFyYWN0ZXIncyB3aWR0aCB2YXJpZXMg KGxpa2UKLSAgICAgICAgICAgICBhIHRhYiksIGlzIG1lYW5pbmdsZXNzIChsaWtlIGEgbmV3bGlu ZSksIG9yIHdlIGp1c3QgZG9uJ3QKLSAgICAgICAgICAgICB3YW50IHRvIHNraXAgb3ZlciBpdCBm b3Igc29tZSBvdGhlciByZWFzb24uICAqLwotICAgICAgICAgIGlmIChjb21tb25fd2lkdGggIT0g MCkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgcHRyZGlmZl90IHJ1bl9lbmRfaHBvczsK LQotICAgICAgICAgICAgICAvKiBEb24ndCBnbyBwYXN0IHRoZSBmaW5hbCBidWZmZXIgcG9zbiB0 aGUgdXNlcgotICAgICAgICAgICAgICAgICByZXF1ZXN0ZWQuICAqLwotICAgICAgICAgICAgICBp ZiAocnVuX2VuZCA+IHRvKQotICAgICAgICAgICAgICAgIHJ1bl9lbmQgPSB0bzsKLQotICAgICAg ICAgICAgICBydW5fZW5kX2hwb3MgPSBocG9zICsgKHJ1bl9lbmQgLSBwb3MpICogY29tbW9uX3dp ZHRoOwotCi0gICAgICAgICAgICAgIC8qIERvbid0IGdvIHBhc3QgdGhlIGZpbmFsIGhvcml6b250 YWwgcG9zaXRpb24gdGhlIHVzZXIKLSAgICAgICAgICAgICAgICAgcmVxdWVzdGVkLiAgKi8KLSAg ICAgICAgICAgICAgaWYgKHZwb3MgPT0gdG92cG9zICYmIHJ1bl9lbmRfaHBvcyA+IHRvaHBvcykK LSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBydW5fZW5kICAgICAgPSBwb3Mg KyAodG9ocG9zIC0gaHBvcykgLyBjb21tb25fd2lkdGg7Ci0gICAgICAgICAgICAgICAgICBydW5f ZW5kX2hwb3MgPSBocG9zICsgKHJ1bl9lbmQgLSBwb3MpICogY29tbW9uX3dpZHRoOwotICAgICAg ICAgICAgICAgIH0KLQotICAgICAgICAgICAgICAvKiBEb24ndCBnbyBwYXN0IHRoZSBtYXJnaW4u ICAqLwotICAgICAgICAgICAgICBpZiAocnVuX2VuZF9ocG9zID49IHdpZHRoKQotICAgICAgICAg ICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHJ1bl9lbmQgICAgICA9IHBvcyArICh3aWR0aCAg LSBocG9zKSAvIGNvbW1vbl93aWR0aDsKLSAgICAgICAgICAgICAgICAgIHJ1bl9lbmRfaHBvcyA9 IGhwb3MgKyAocnVuX2VuZCAtIHBvcykgKiBjb21tb25fd2lkdGg7Ci0gICAgICAgICAgICAgICAg fQotCi0gICAgICAgICAgICAgIGhwb3MgPSBydW5fZW5kX2hwb3M7Ci0gICAgICAgICAgICAgIGlm IChydW5fZW5kID4gcG9zKQotICAgICAgICAgICAgICAgIHByZXZfaHBvcyA9IGhwb3MgLSBjb21t b25fd2lkdGg7Cis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TbywgaWYgdGhl eSBhcmUgdCwgd2UgY2FuCi0gICAgICAgICBza2lwIG9uZSBieSBvbmUgY2hlY2tpbmcgb2YgcHJv cGVydGllcy4gICovCisJIFZ0ZXh0X3Byb3BlcnR5X2RlZmF1bHRfbm9uc3RpY2t5LiAgU28sIGlm IHRoZXkgYXJlIHQsIHdlIGNhbgorCSBza2lwIG9uZSBieSBvbmUgY2hlY2tpbmcgb2YgcHJvcGVy dGllcy4gICovCiAgICAgICByZWFyID0gdGV4dGdldCAoaS0+cGxpc3QsIFFyZWFyX25vbnN0aWNr eSk7CiAgICAgICBpZiAoISBDT05TUCAocmVhcikgJiYgISBOSUxQIChyZWFyKSkKIAl7CkBAIC04 OTcsNyArODk3LDcgQEAgYWRqdXN0X2ludGVydmFsc19mb3JfaW5zZXJ0aW9uIChJTlRFUlZBTCB0 cmVlLAogCX0KIAogICAgICAgLyogRG9lcyBhbnkgYWN0dWFsIHByb3BlcnR5IHBvc2UgYW4gYWN0 dWFsIHByb2JsZW0/ICBXZSBicmVhawotICAgICAgICAgdGhlIGxvb3AgaWYgd2UgZmluZCBhIG5v bnN0aWNreSBwcm9wZXJ0eS4gICovCisJIHRoZSBsb29wIGlmIHdlIGZpbmQgYSBub25zdGlja3kg cHJvcGVydHkuICAqLwogICAgICAgZm9yICg7IENPTlNQICh0YWlsKTsgdGFpbCA9IEZjZHIgKFhD RFIgKHRhaWwpKSkKIAl7CiAJICBMaXNwX09iamVjdCBwcm9wLCB0bXA7CkBAIC05MTIsNyArOTEy LDcgQEAgYWRqdXN0X2ludGVydmFsc19mb3JfaW5zZXJ0aW9uIChJTlRFUlZBTCB0cmVlLAogCSAg ICBicmVhazsKIAogCSAgLyogSXMgdGhpcyBwYXJ0aWN1bGFyIHByb3BlcnR5IHJlY29yZGVkIGFz IHN0aWNreSBvcgotICAgICAgICAgICAgIG5vbnN0aWNreSBpbiBWdGV4dF9wcm9wZXJ0eV9kZWZh dWx0X25vbnN0aWNreT8gICovCisJICAgICBub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kIHNldF9pbnRlcnZh bHNfbXVsdGlieXRlIChib29sKTsKIGV4dGVybiBJTlRFUlZBTCB2YWxpZGF0ZV9pbnRlcnZhbF9y YW5nZSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0ICosCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0ICosIGJvb2wpOworCQkJCQkgTGlzcF9PYmpl Y3QgKiwgYm9vbCk7CiBleHRlcm4gSU5URVJWQUwgaW50ZXJ2YWxfb2YgKHB0cmRpZmZfdCwgTGlz cF9PYmplY3QpOwogCiAvKiBEZWZpbmVkIGluIHhkaXNwLmMuICAqLwpAQCAtMjc3LDIyICsyNzcs MjIgQEAgZXh0ZXJuIGludCBpbnZpc2libGVfcHJvcCAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0 KTsKIAogLyogRGVmaW5lZCBpbiB0ZXh0cHJvcC5jLiAgKi8KIGV4dGVybiBMaXNwX09iamVjdCBj b3B5X3RleHRfcHJvcGVydGllcyAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0LAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCwgTGlzcF9PYmplY3Qs Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0LCBM aXNwX09iamVjdCk7CisJCQkJCSBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsCisJCQkJCSBMaXNw X09iamVjdCwgTGlzcF9PYmplY3QpOwogZXh0ZXJuIExpc3BfT2JqZWN0IHNldF90ZXh0X3Byb3Bl cnRpZXMgKExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QpOworCQkJCQlMaXNwX09iamVj dCwgTGlzcF9PYmplY3QsCisJCQkJCUxpc3BfT2JqZWN0KTsKIGV4dGVybiB2b2lkIHNldF90ZXh0 X3Byb3BlcnRpZXNfMSAoTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0LAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsIElOVEVSVkFMKTsK KwkJCQkgICBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsIElOVEVSVkFMKTsKIAogTGlzcF9PYmpl Y3QgdGV4dF9wcm9wZXJ0eV9saXN0IChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsIExpc3BfT2Jq ZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCk7CisJCQkJ TGlzcF9PYmplY3QpOwogdm9pZCBhZGRfdGV4dF9wcm9wZXJ0aWVzX2Zyb21fbGlzdCAoTGlzcF9P YmplY3QsIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCk7CiBMaXNwX09iamVjdCBleHRlbmRfcHJv cGVydHlfcmFuZ2VzIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0KTsKIExp c3BfT2JqZWN0IGdldF9jaGFyX3Byb3BlcnR5X2FuZF9vdmVybGF5IChMaXNwX09iamVjdCwgTGlz cF9PYmplY3QsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QsIExpc3BfT2JqZWN0Kik7CisJCQkJCSAgIExpc3BfT2JqZWN0LCBMaXNwX09iamVj dCopOwogZXh0ZXJuIGludCB0ZXh0X3Byb3BlcnR5X3N0aWNraW5lc3MgKExpc3BfT2JqZWN0IHBy b3AsIExpc3BfT2JqZWN0IHBvcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBMaXNwX09iamVjdCBidWZmZXIpOworCQkJCSAgICAgTGlzcF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yB3aXRoaW4gYSBtYWNybwogCSAgICAganVzdCBiZWNhdXNlIGEgY29t bWFuZCBpbiB0aGUgbWFjcm8gZmluaXNoZXMuICAqLwogCSAgaWYgKE5JTFAgKFZleGVjdXRpbmdf a2JkX21hY3JvKSkKLSAgICAgICAgICAgIHVuYmluZF90byAoc2NvdW50LCBRbmlsKTsKKwkgICAg dW5iaW5kX3RvIChzY291bnQsIFFuaWwpOwogI2VuZGlmCi0gICAgICAgICAgfQorCSAgfQogICAg ICAga3NldF9sYXN0X3ByZWZpeF9hcmcgKGN1cnJlbnRfa2JvYXJkLCBWY3VycmVudF9wcmVmaXhf YXJnKTsKIAogICAgICAgc2FmZV9ydW5faG9va3MgKFFwb3N0X2NvbW1hbmRfaG9vayk7CkBAIC0x NTA3LDcgKzE1MDcsNyBAQCBjb21tYW5kX2xvb3BfMSAodm9pZCkKIAogICAgICAgLyogSWYgdGhl cmUgYXJlIHdhcm5pbmdzIHdhaXRpbmcsIHByb2Nlc3MgdGhlbS4gICovCiAgICAgICBpZiAoIU5J TFAgKFZkZWxheWVkX3dhcm5pbmdzX2xpc3QpKQotICAgICAgICBzYWZlX3J1bl9ob29rcyAoUWRl bGF5ZWRfd2FybmluZ3NfaG9vayk7CisJc2FmZV9ydW5faG9va3MgKFFkZWxheWVkX3dhcm5pbmdz X2hvb2spOwogCiAgICAgICBzYWZlX3J1bl9ob29rcyAoUWRlZmVycmVkX2FjdGlvbl9mdW5jdGlv bik7CiAKQEAgLTE2NjQsNyArMTY2NCw3IEBAIGFkanVzdF9wb2ludF9mb3JfcHJvcGVydHkgKHB0 cmRpZmZfdCBsYXN0X3B0LCBib29sIG1vZGlmaWVkKQogICAgICAgaWYgKGNoZWNrX2Rpc3BsYXkK IAkgICYmIFBUID4gQkVHViAmJiBQVCA8IFpWCiAJICAmJiAhTklMUCAodmFsID0gZ2V0X2NoYXJf cHJvcGVydHlfYW5kX292ZXJsYXkKLQkJICAgICAgICAgICAgICAobWFrZV9udW1iZXIgKF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0RSIChsYXN0KTsKLSAgICAgICAg ICBpZiAoIU5JTFAgKFhDRFIgKGxhc3QpKSkKKwkgIGlmICghTklMUCAoWENEUiAobGFzdCkpKQog CSAgICBlbWFjc19hYm9ydCAoKTsKLSAgICAgICAgfQorCX0KICAgICAgIGlmICghQ09OU1AgKGxh c3QpKQotICAgICAgICBrc2V0X2tiZF9xdWV1ZSAoa2IsIGxpc3QxIChjKSk7CisJa3NldF9rYmRf cXVldWUgKGtiLCBsaXN0MSAoYykpOwogICAgICAgZWxzZQotICAgICAgICBYU0VUQ0RSIChsYXN0 LCBsaXN0MSAoYykpOworCVhTRVRDRFIgKGxhc3QsIGxpc3QxIChjKSk7CiAgICAgICBrYi0+a2Jk X3F1ZXVlX2hhc19kYXRhID0gdHJ1ZTsKICAgICAgIGMgPSBRbmlsOwogICAgICAgaWYgKHNpbmds ZV9rYm9hcmQpCi0gICAgICAgIGdvdG8gc3RhcnQ7CisJZ290byBzdGFydDsKICAgICAgIGN1cnJl bnRfa2JvYXJkID0ga2I7CiAgICAgICByZXR1cm4gbWFrZV9udW1iZXIgKC0yKTsKICAgICB9CkBA IC0yMjA1LDkgKzIyMDUsOSBAQCByZWFkX2V2ZW50X2Zyb21fbWFpbl9xdWV1ZSAoc3RydWN0IHRp bWVzcGVjICplbmRfdGltZSwKICAgIHRvIHR0eSBpbnB1dC4gICovCiBzdGF0aWMgTGlzcF9PYmpl Y3QKIHJlYWRfZGVjb2RlZF9ldmVudF9mcm9tX21haW5fcXVldWUgKHN0cnVjdCB0aW1lc3BlYyAq ZW5kX3RpbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzeXNfam1wX2J1 ZiBsb2NhbF9nZXRjam1wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlz cF9PYmplY3QgcHJldl9ldmVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGJvb2wgKnVzZWRfbW91c2VfbWVudSkKKwkJC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ogICAgICAgaWYgKElOVEVHRVJQIChjKSAmJiBYSU5UIChj KSA9PSAtMikKLSAgICAgICAgcmV0dXJuIGM7ICAgICAgICAgICAgICAgLyogd3Jvbmdfa2JvYXJk X2ptcGJ1ZiAqLworCXJldHVybiBjOyAgICAgICAgICAgICAgIC8qIHdyb25nX2tib2FyZF9qbXBi dWYgKi8KIAogICAgICAgaWYgKCEgTklMUCAoYykpCiAJZ290byBleGl0OwpAQCAtMjYwNCw3ICsy NjA0LDcgQEAgcmVhZF9jaGFyIChpbnQgY29tbWFuZGZsYWcsIExpc3BfT2JqZWN0IG1hcCwKIAkg ICAgICBYU0VUQ0RSIChsYXN0LCBsaXN0MSAoYykpOwogCSAgICBrYi0+a2JkX3F1ZXVlX2hhc19k YXRhID0gdHJ1ZTsKIAkgICAgY3VycmVudF9rYm9hcmQgPSBrYjsKLSAgICAgICAgICAgIHJldHVy biBtYWtlX251bWJlciAoLTIpOyAvKiB3cm9uZ19rYm9hcmRfam1wYnVmICovCisJICAgIHJldHVy biBtYWtlX251bWJlciAoLTIpOyAvKiB3cm9uZ19rYm9hcmRfam1wYnVmICovCiAJICB9CiAgICAg ICB9CiAgICAgICBnb3RvIG5vbl9yZXJlYWQ7CkBAIC0yNzk3LDcgKzI3OTcsNyBAQCByZWFkX2No YXIgKGludCBjb21tYW5kZmxhZywgTGlzcF9PYmplY3QgbWFwLAogCWlmIChrYi0+a2JkX3F1ZXVl X2hhc19kYXRhKQogCSAgewogCSAgICBjdXJyZW50X2tib2FyZCA9IGtiOwotICAgICAgICAgICAg cmV0dXJuIG1ha2VfbnVtYmVyICgtMik7IC8qIHdyb25nX2tib2FyZF9qbXBidWYgKi8KKwkgICAg cmV0dXJuIG1ha2VfbnVtYmVyICgtMik7IC8qIHdyb25nX2tib2FyZF9qbXBidWYgKi8KIAkgIH0K ICAgICB9CiAKQEAgLTI4MDgsMTIgKzI4MDgsMTIgQEAgcmVhZF9jaGFyIChpbnQgY29tbWFuZGZs YWcsIExpc3B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iAgKi8KIAkgIGVtYWNzX2Fib3J0ICgpOwogI2VuZGlmCiAJfQogCiAjaWYgZGVmaW5lZCAo SEFWRV9OUykKICAgICAgIGVsc2UgaWYgKGV2ZW50LT5raW5kID09IE5TX1RFWFRfRVZFTlQpCi0g ICAgICAgIHsKLSAgICAgICAgICBpZiAoZXZlbnQtPmllLmNvZGUgPT0gS0VZX05TX1BVVF9XT1JL SU5HX1RFWFQpCi0gICAgICAgICAgICBvYmogPSBsaXN0MSAoaW50ZXJuICgibnMtcHV0LXdvcmtp bmctdGV4dCIpKTsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICBvYmogPSBsaXN0MSAoaW50 ZXJuICgibnMtdW5wdXQtd29ya2luZy10ZXh0IikpOworCXsKKwkgIGlmIChldmVudC0+aWUuY29k ZSA9PSBLRVlfTlNfUFVUX1dPUktJTkdfVEVYVCkKKwkgICAgb2JqID0gbGlzdDEgKGludGVybiAo Im5zLXB1dC13b3JraW5nLXRleHQiKSk7CisJICBlbHNlCisJICAgIG9iaiA9IGxpc3QxIChpbnRl cm4gKCJucy11bnB1dC13b3JraW5nLXRleHQiKSk7CiAJICBrYmRfZmV0Y2hfcHRyID0gZXZlbnQg KyAxOwotICAgICAgICAgIGlmICh1c2VkX21vdXNlX21lbnUpCi0gICAgICAgICAgICAqdXNlZF9t b3VzZV9tZW51ID0gdHJ1ZTsKLSAgICAgICAgfQorCSAgaWYgKHVzZWRfbW91c2VfbWVudSkKKwkg ICAgKnVzZWRfbW91c2VfbWVudSA9IHRydWU7CisJfQogI2VuZGlmCiAKICNpZiBkZWZpbmVkIChI QVZFX1gxMSkgfHwgZGVmaW5lZCAoSEFWRV9OVEdVSSkgXApAQCAtMzk4MCwxNiArMzk4MCwxNiBA QCBrYmRfYnVmZmVyX2dldF9ldmVudCAoS0JPQVJEICoqa2JwLAogCSAgLyogTWFrZSBhbiBldmVu dCAoZmlsZS1ub3RpZnkgKERFU0NSSVBUT1IgQUNUSU9OIEZJTEUpIENB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B0aW1lciB0aGF0IGlzIHN0aWxsIHdhaXRpbmcsCkBAIC01NDI2 LDMzICs1NDI2LDMzIEBAIG1ha2VfbGlzcHlfZXZlbnQgKHN0cnVjdCBpbnB1dF9ldmVudCAqZXZl bnQpCiAJICB7CiAJICAgIGMgJj0gMDM3NzsKIAkgICAgZWFzc2VydCAoYyA9PSBldmVudC0+Y29k ZSk7Ci0gICAgICAgICAgfQotCi0gICAgICAgIC8qIENhcHMtbG9jayBzaG91bGRuJ3QgYWZmZWN0 IGludGVycHJldGF0aW9uIG9mIGtleSBjaG9yZHM6Ci0gICAgICAgICAgIENvbnRyb2wrcyBzaG91 bGQgcHJvZHVjZSBDLXMgd2hldGhlciBjYXBzLWxvY2sgaXMgb24gb3IKLSAgICAgICAgICAgbm90 LiAgQW5kIENvbnRyb2wrU2hpZnQrcyBzaG91bGQgcHJvZHVjZSBDLVMtcyB3aGV0aGVyCi0gICAg ICAgICAgIGNhcHMtbG9jayBpcyBvbiBvciBub3QuICAqLwotICAgICAgICBpZiAoZXZlbnQtPm1v ZGlmaWVycyAmIH5zaGlmdF9tb2RpZmllcikKLSAgICAgICAgewotICAgICAgICAgICAgLyogVGhp cyBpcyBhIGtleSBjaG9yZDogc29tZSBub24tc2hpZnQgbW9kaWZpZXIgaXMKLSAgICAgICAgICAg ICAgIGRlcHJlc3NlZC4gICovCi0KLSAgICAgICAgICAgIGlmICh1cHBlcmNhc2VwIChjKSAmJgot ICAgICAgICAgICAgICAgICEoZXZlbnQtPm1vZGlmaWVycyAmIHNoaWZ0X21vZGlmaWVyKSkKLSAg ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAvKiBHb3QgYSBjYXBpdGFsIGxldHRlciB3aXRo b3V0IGEgc2hpZnQuICBUaGUgY2FwcwotICAgICAgICAgICAgICAgICAgIGxvY2sgaXMgb24uICAg VW4tY2FwaXRhbGl6ZSB0aGUgbGV0dGVyLiAgKi8KLSAgICAgICAgICAgICAgICBjID0gZG93bmNh c2UgKGMpOwotICAgICAgICAgICAgfQotICAgICAgICAgICAgZWxzZSBpZiAobG93ZXJjYXNlcCAo YykgJiYKLSAgICAgICAgICAgICAgICAgICAgIChldmVudC0+bW9kaWZpZXJzICYgc2hpZnRfbW9k aWZpZXIpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIC8qIEdvdCBhIGxvd2VyLWNh c2UgbGV0dGVyIGV2ZW4gdGhvdWdoIHNoaWZ0IGlzCi0gICAgICAgICAgICAgICAgICAgZGVwcmVz c2VkLiAgVGhlIGNhcHMgbG9jayBpcyBvbi4gIENhcGl0YWxpemUgdGhlCi0gICAgICAgICAgICAg ICAgICAgbGV0dGVyLiAgKi8KLSAgICAgICAgICAgICAgICBjID0gdXBjYXNlIChjKTsKLSAgICAg ICAgICAgIH0KLSAgICAgICAgfQorCSAgfQorCisJLyogQ2Fwcy1sb2NrIHNob3VsZG4ndCBhZmZl Y3QgaW50ZXJwcmV0YXRpb24gb2Yga2V5IGNob3JkczoKKwkgICBDb250cm9sK3Mgc2hvdWxkIHBy b2R1Y2UgQy1zIHdoZXRoZXIgY2Fwcy1sb2NrIGlzIG9uIG9yCisJICAgbm90LiAgQW5kIENvbnRy b2wrU2hpZnQrcyBzaG91bGQgcHJvZHVjZSBDLVMtcyB3aGV0aGVyCisJICAgY2Fwcy1sb2NrIGlz IG9uIG9yIG5vdC4gICovCisJaWYgKGV2ZW50LT5tb2RpZmllcnMgJiB+c2hpZnRfbW9kaWZpZXIp CisJeworCSAgICAvKiBUaGlzIGlzIGEga2V5IGNob3JkOiBzb21lIG5vbi1zaGlmdCBtb2RpZmll ciBpcworCSAgICAgICBkZXByZXNzZWQuICAqLworCisJICAgIGlmICh1cHBlcmNhc2VwIChjKSAm JgorCQkhKGV2ZW50LT5tb2RpZmllcnMgJiBzaGlmdF9tb2RpZmllcikpCisJICAgIHsKKwkJLyog R290IGEgY2FwaXRhbCBsZXR0ZXIgd2l0aG91dCBhIHNoaWZ0LiAgVGhlIGNhcHMKKwkJ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gZm9yIEZJT05SRUFEIG9yIGZjbnRsOyBqdXN0IHNheSBkb24ndCB3 YWl0LiAgKi8KKwkgIC8qIE5vIG5lZWQgZm9yIEZJT05SRUFEIG9yIGZjbnRsOyBqdXN0IHNheSBk b24ndCB3YWl0LiAgKi8KIAkgIHdoaWxlICgobnIgPSAoKnQtPnJlYWRfc29ja2V0X2hvb2spICh0 LCAmaG9sZF9xdWl0KSkgPiAwKQogCSAgICBucmVhZCArPSBucjsKIAotICAgICAgICAgIGlmIChu ciA9PSAtMSkgICAgICAgICAgLyogTm90IE9LIHRvIHJlYWQgaW5wdXQgbm93LiAgKi8KLSAgICAg ICAgICAgIHsKLSAgICAgICAgICAgICAgZXJyID0gdHJ1ZTsKLSAgICAgICAgICAgIH0KLSAgICAg ICAgICBlbHNlIGlmIChuciA9PSAtMikgICAgICAgICAgLyogTm9uLXRyYW5zaWVudCBlcnJvci4g ICovCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIC8qIFRoZSB0ZXJtaW5hbCBkZXZpY2Ug dGVybWluYXRlZDsgaXQgc2hvdWxkIGJlIGNsb3NlZC4gICovCi0KLSAgICAgICAgICAgICAgLyog S2lsbCBFbWFjcyBpZiB0aGlzIHdhcyBvdXIgbGFzdCB0ZXJtaW5hbC4gICovCi0gICAgICAgICAg ICAgIGlmICghdGVybWluYWxfbGlzdC0+bmV4dF90ZXJtaW5hbCkKLSAgICAgICAgICAgICAgICAv KiBGb3JtZXJseSBzaW1wbHkgcmVwb3J0ZWQgbm8gaW5wdXQsIGJ1dCB0aGF0Ci0gICAgICAgICAg ICAgICAgICAgc29tZXRpbWVzIGxlZCB0byBhIGZhaWx1cmUgb2YgRW1hY3MgdG8gdGVybWluYXRl LgotICAgICAgICAgICAgICAgICAgIFNJR0hVUCBzZWVtcyBhcHByb3ByaWF0ZSBpZiB3ZSBjYW4n dCByZWFjaCB0aGUKLSAgICAgICAgICAgICAgICAgICB0ZXJtaW5hbC4gICovCi0gICAgICAgICAg ICA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dF9jaGFyKQorCWJyZWFrOwogICAgIH0KIAogICByZXR1cm4gbnJlYWQ7CkBAIC03MjY3LDE4 ICs3MjY3LDE4IEBAIGhhbmRsZV91c2VyX3NpZ25hbCAoaW50IHNpZykKICAgZm9yIChwID0gdXNl cl9zaWduYWxzOyBwOyBwID0gcC0+bmV4dCkKICAgICBpZiAocC0+c2lnID09IHNpZykKICAgICAg IHsKLSAgICAgICAgaWYgKHNwZWNpYWxfZXZlbnRfbmFtZQorCWlmIChzcGVjaWFsX2V2ZW50X25h bWUKIAkgICAgJiYgc3RyY21wIChzcGVjaWFsX2V2ZW50X25hbWUsIHAtPm5hbWUpID09IDApCi0g ICAgICAgICAgewotICAgICAgICAgICAgLyogRW50ZXIgdGhlIGRlYnVnZ2VyIGluIG1hbnkgd2F5 cy4gICovCi0gICAgICAgICAgICBkZWJ1Z19vbl9uZXh0X2NhbGwgPSB0cnVlOwotICAgICAgICAg ICAgZGVidWdfb25fcXVpdCA9IHRydWU7Ci0gICAgICAgICAgICBWcXVpdF9mbGFnID0gUXQ7Ci0g ICAgICAgICAgICBWaW5oaWJpdF9xdWl0ID0gUW5pbDsKKwkgIHsKKwkgICAgLyogRW50ZXIgdGhl IGRlYnVnZ2VyIGluIG1hbnkgd2F5cy4gICovCisJICAgIGRlYnVnX29uX25leHRfY2FsbCA9IHRy dWU7CisJICAgIGRlYnVnX29uX3F1aXQgPSB0cnVlOworCSAgICBWcXVpdF9mbGFnID0gUXQ7CisJ ICAgIFZpbmhpYml0X3F1aXQgPSBRbmlsOwogCi0gICAgICAgICAgICAvKiBFYXQgdGhlIGV2ZW50 LiAgKi8KLSAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgIH0KKwkgICAgLyogRWF0IHRoZSBl dmVudC4gICovCisJICAgIGJyZWFrOworCSAgfQogCiAJcC0+bnBlbmRpbmcrKzsKICNpZmRlZiBV U0FCTEVfU0lHSU8KQEAgLTczODYsNyArNzM4Niw3IEBAIG1lbnVfc2VwYXJhdG9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udF9yZWRpc3BsYXkgPyAtMiA6IE5JTFAgKHByb21w dCksCi0JCSAgICAgICAgICAgICBjdXJyZW50X2JpbmRpbmcsIGxhc3Rfbm9ubWVudV9ldmVudCwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJnVzZWRfbW91c2VfbWVudSwgTlVMTCk7CisJ CQkgICAgIGN1cnJlbnRfYmluZGluZywgbGFzdF9ub25tZW51X2V2ZW50LAorCQkJICAgICAmdXNl ZF9tb3VzZV9tZW51LCBOVUxMKTsKIAkgICAgaWYgKChJTlRFR0VSUCAoa2V5KSAmJiBYSU5UIChr ZXkpID09IC0yKSAvKiB3cm9uZ19rYm9hcmRfam1wYnVmICovCiAJCS8qIFdoZW4gc3dpdGNoaW5n IHRvIGEgbmV3IHR0eSAod2l0aCBhIG5ldyBrZXlib2FyZCksCiAJCSAgIHJlYWRfY2hhciByZXR1 cm5zIHRoZSBuZXcgYnVmZmVyLCByYXRoZXIgdGhhbiAtMgpAQCAtOTk4Miw3ICs5OTgyLDcgQEAg SWYgQ0hFQ0stVElNRVJTIGlzIG5vbi1uaWwsIHRpbWVycyB0aGF0IGFyZSByZWFkeSB0byBydW4g d2lsbCBkbyBzby4gICovKQogICBwcm9jZXNzX3NwZWNpYWxfZXZlbnRzICgpOwogCiAgIHJldHVy biAoZ2V0X2lucHV0X3BlbmRpbmcgKChOSUxQIChjaGVja190aW1lcnMpCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICA/IDAgOiBSRUFEQUJMRV9FVkVOVFNfRE9fVElNRVJTX05PVykKKwkJ CSAgICAgID8gMCA6IFJFQURBQkxFX0VWRU5UU19ET19USU1FUlNfTk9XKQogCQkJICAgICB8IFJF QURBQkxFX0VWRU5UU19GSUxURVJfRVZFTlRTKQogCSAgPyBRdCA6IFFuaWwpOwogfQpAQCAtMTAy ODgsOSArMTAyODgsOSBAQCBoYW5kbGVfaW50ZXJydXB0X3NpZ25hbCAoaW50IHNpZykKICAgaWYg KCF0ZXJta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CBFTUFDU19VSU5UICopOwogcHRyZGlmZl90IGhhc2hfcHV0IChzdHJ1Y3QgTGlz cF9IYXNoX1RhYmxlICosIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCwKIAkJICAgIEVNQUNTX1VJ TlQpOwpAQCAtMzcxNSwxMSArMzcxNSwxMSBAQCBleHRlcm4gdm9pZCByX2FsbG9jX2luaGliaXRf YnVmZmVyX3JlbG9jYXRpb24gKGludCk7CiAvKiBEZWZpbmVkIGluIGNoYXJ0YWIuYy4gICovCiBl eHRlcm4gTGlzcF9PYmplY3QgY29weV9jaGFyX3RhYmxlIChMaXNwX09iamVjdCk7CiBleHRlcm4g TGlzcF9PYmplY3QgY2hhcl90YWJsZV9yZWZfYW5kX3JhbmdlIChMaXNwX09iamVjdCwgaW50LAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50ICosIGludCAq KTsKKwkJCQkJICAgICBpbnQgKiwgaW50ICopOwogZXh0ZXJuIHZvaWQgY2hhcl90YWJsZV9zZXRf cmFuZ2UgKExpc3BfT2JqZWN0LCBpbnQsIGludCwgTGlzcF9PYmplY3QpOwogZXh0ZXJuIHZvaWQg bWFwX2NoYXJfdGFibGUgKHZvaWQgKCopIChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QpLAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgIExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QpOworCQkJICAg IExpc3BfT2JqZWN0KSwKKwkJCSAgICBMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsIExpc3BfT2Jq ZWN0KTsKIGV4dGVybiB2b2lkIG1hcF9jaGFyX3RhYmxlX2Zvcl9jaGFyc2V0ICh2b2lkICgqY19m dW5jdGlvbikgKExpc3BfT2JqZWN0LCBMaXNwX09iamVjdCksCiAJCQkJCUxpc3BfT2JqZWN0LC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mFsX3N0YXJ0IChMaXNwX09iamVjdCwgTGlzcF9PYmplY3QsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QpOworCQkJCQlMaXNw X09iamVjdCk7CiBzdGF0aWMgTGlzcF9PYmplY3QgcmVhZDAgKExpc3BfT2JqZWN0KTsKIHN0YXRp YyBMaXNwX09iamVjdCByZWFkMSAoTGlzcF9PYmplY3QsIGludCAqLCBib29sKTsKIApAQCAtNTU3 LDkgKzU1Nyw5IEBAIHN0YXRpYyBMaXNwX09iamVjdCByZWFkX2xpc3QgKGJvb2wsIExpc3BfT2Jq ZWN0KTsKIHN0YXRpYyBMaXNwX09iamVjdCByZWFkX3ZlY3RvciAoTGlzcF9PYmplY3QsIGJvb2wp OwogCiBzdGF0aWMgTGlzcF9PYmplY3Qgc3Vic3RpdHV0ZV9vYmplY3RfcmVjdXJzZSAoTGlzcF9P YmplY3QsIExpc3BfT2JqZWN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIExpc3BfT2JqZWN0KTsKKwkJCQkJICAgICAgTGlzcF9PYmplY3QpOwogc3RhdGlj IHZvaWQgc3Vic3RpdHV0ZV9vYmplY3RfaW5fc3VidHJlZSAoTGlzcF9PYmplY3QsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCk7CisJCQkJCSAg TGlzcF9PYmplY3QpOwogc3RhdGljIHZvaWQgc3Vic3RpdHV0ZV9pbl9pbnRlcnZhbCAoSU5URVJW QUwsIExpc3BfT2JqZWN0KTsKIAogDApAQCAtNzgxLDE2ICs3ODEsMTYgQEAgbGlzcF9maWxlX2xl eGljYWxseV9ib3VuZF9wIChMaXNwX09iamVjdCByZWFkY2hhcmZ1bikKICAgICB7CiAgICAgICBj aCA9IFJFQURDSEFSOwogICAgICAgaWYgKGNoICE9ICchJykKLSAgICAgICAgewotICAgICAgICAg IFVOUkVBRCAoY2gpOwotICAgICAgICAgIFVOUkVBRCAoJyMnKTsKLSAgICAgICAgICByZXR1cm4g MDsKLSAgICAgICAgfQorCXsKKwkgIFVOUkVBRCAoY2gpOworCSAgVU5SRUFEICgnIycpOworCSAg cmV0dXJuIDA7CisJfQogICAgICAgd2hpbGUgKGNoICE9ICdcbicgJiYgY2ggIT0gRU9GKQotICAg ICAgICBjaCA9IFJFQURDSEFSOworCWNoID0gUkVBRENIQVI7CiAgICAgICBpZiAoY2ggPT0gJ1xu JykgY2ggPSBSRUFEQ0hBUjsKICAgICAgIC8qIEl0IGlzIE9LIHRvIGxlYXZlIHRoZSBwb3NpdGlv biBhZnRlciBhICMhIGxpbmUsIHNpbmNlCi0gICAgICAgICB0aGF0IGlzIHdoYXQgcmVhZDEgZG9l cy4gICovCisJIHRoYXQgaXMgd2hhdCByZWFkMSBkb2VzLiAgKi8KICAgICB9CiAKICAgaWYgKGNo ICE9ICc7JykKQEAgLTExOTQsOSArMTE5NCw5IEBAIFJldHVybiB0IGlmIHRoZSBmaWxlIGV4aXN0 cyBhbmQgbG9hZHMgc3VjY2Vzc2Z1bGx5LiAgKi8pCiAKICAgLyogR2V0IHRoZSBuYW1lIGZvciBs b2FkLWhpc3RvcnkuICAqLwogICBoaXN0X2ZpbGVfbmFtZSA9ICghIE5JTFAgKFZwdXJpZnlfZmxh ZykKLSAgICAgICAgICAgICAgICAgICAgPyBjb25jYXQyIChGZmlsZV9uYW1lX2RpcmVjdG9yeSAo ZmlsZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRmZpbGVfbmFtZV9ub25kaXJl Y3RvcnkgKGZvdW5kKSkKLSAgICAgICAgICAgICAgICAgICAgOiBmb3VuZCkgOworCQkgICAgPyBj b25jYXQyIChGZmlsZV9uYW1lX2RpcmVjdG9yeSAoZmlsZSksCisJCQkgICAgICAgRmZpbGVfbmFt ZV9ub25kaXJlY3RvcnkgKGZvdW5kKSkKKwkJICAgIDogZm91bmQpIDsKIAogICB2ZXJzaW9uID0g LTE7CiAKQEAgLTEyMzIsMzUgKzEyMzIsMzUgQEAgUmV0dXJuIHQgaWYgdGhlIGZpbGUgZXhpc3Rz IGFuZCBsb2FkcyBzdWNjZXNzZnVsbHkuICAqLykKIAkgIGVmb3VuZCA9IEVOQ09ERV9GSUxFIChm b3VuZCk7CiAJICBmbW9kZSA9ICJyIiBGT1BFTl9CSU5BUlk7CiAKLSAgICAgICAgICAvKiBvcGVu cCBhbHJlYWR5IGNoZWNrZWQgZm9yIG5ld25lc3MsIG5vIHBvaW50IGRvaW5nIGl0IGFnYWluLgot ICAgICAgICAgICAgIEZJWE1FIHdvdWxkIGJlIG5pY2UgdG8gZ2V0IGEgbWVzc2FnZSB3aGVuIG9w ZW5wCi0gICAgICAgICAgICAgaWdub3JlcyBzdWZmaXggb3JkZXIgZHVlIHRvIGxvYWRfcHJlZmVy X25ld2VyLiAgKi8KLSAgICAgICAgICBpZiAoIWxvYWRfcHJlZmVyX25ld2VyICYmIGlzX2VsYykK LSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgcmVzdWx0ID0gc3RhdCAoU1NEQVRBIChlZm91 bmQpLCAmczEpOwotICAgICAgICAgICAgICBpZiAocmVzdWx0ID09IDApCi0gICAgICAgICAgICAg ICAgewotICAgICAgICAgICAgICAgICAgU1NFVCAoZWZvdW5kLCBTQllURVMgKGVmb3VuZCkgLSAx LCAwKTsKLSAgICAgICAgICAgICAgICAgIHJlc3VsdCA9IHN0YXQgKFNTREFUQSAoZWZvdW5kKSwg JnMyKTsKLSAgICAgICAgICAgICAgICAgIFNTRVQgKGVmb3VuZCwgU0JZVEVTIChlZm91bmQpIC0g MSwgJ2MnKTsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgaWYgKHJlc3VsdCA9 PSAwCi0gICAgICAgICAgICAgICAgICAmJiB0aW1lc3BlY19jbXAgKGdldF9zdGF0X210aW1lICgm czEpLCBnZXRfc3RhdF9tdGltZSAoJnMyKSkgPCAwKQotICAgICAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgICAgIC8qIE1ha2UgdGhlIHByb2dyZXNzIG1lc3NhZ2VzIG1lbnRpb24gdGhhdCBz b3VyY2UgaXMgbmV3ZXIuICAqLwotICAgICAgICAgICAgICAgICAgbmV3ZXIgPSAxOwotCi0gICAg ICAgICAgICAgICAgICAvKiBJZiB3ZSB3b24ndCBwcmludCBhbm90aGVyIG1lc3NhZ2UsIG1lbnRp b24gdGhpcyBhbnl3YXkuICAqLwotICAgICAgICAgICAgICAgICAgaWYgKCFOSUxQIChub21lc3Nh Z2UpICYmICFmb3JjZV9sb2FkX21lc3NhZ2VzKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAg ICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgbXNnX2ZpbGU7Ci0gICAgICAgICAgICAgICAg ICAgICAgbXNnX2ZpbGUgPSBGc3Vic3RyaW5nIChmb3VuZCwgbWFrZV9udW1iZXIgKDApLCBtYWtl X251bWJlciAoLTEpKTsKLSAgICAgICAgICAgICAgICAgICAgICBtZXNzYWdlX3dpdGhfc3RyaW5n ICgiU291cmNlIGZpbGUgYCVzJyBuZXdlciB0aGFuIGJ5dGUtY29tcGlsZWQgZmlsZSIsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbXNnX2ZpbGUsIDEpOwotICAg ICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfSAvKiAh bG9hZF9wcmVmZXJfbmV3ZXIgKi8KKwkgIC8qIG9wZW5wIGFscmVhZHkgY2hlY2tlZCBmb3IgbmV3 bmVzcywgbm8gcG9pbnQgZG9pbmcgaXQgYWdhaW4uCisJICAgICBGSVhNRSB3b3VsZCBiZSBuaWNl IHRvIGdldCBhIG1lc3NhZ2Ugd2hlbiBvcGVucAorCSAgICAgaWdub3JlcyBzdWZmaXggb3JkZXIg ZHVlIHRvIGxvYWRfcHJlZ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gICAgICAgICAgICAgICAgICBzdHJ1Y3QgdGlt ZXNwZWMgbXRpbWUgPSBnZXRfc3RhdF9tdGltZSAoJnN0KTsKKwkJICBpZiAobmV3ZXIgJiYgIU5B VE5VTVAgKHByZWRpY2F0ZSkpCisJCSAgICB7CisJCSAgICAgIHN0cnVjdCB0aW1lc3BlYyBtdGlt ZSA9IGdldF9zdGF0X210aW1lICgmc3QpOwogCiAJCSAgICAgIGlmICh0aW1lc3BlY19jbXAgKG10 aW1lLCBzYXZlX210aW1lKSA8PSAwKQogCQkJZW1hY3NfY2xvc2UgKGZkKTsKIAkJICAgICAgZWxz ZQotICAgICAgICAgICAgICAgICAgICAgICAgeworCQkJewogCQkJICBpZiAoMCA8PSBzYXZlX2Zk KQogCQkJICAgIGVtYWNzX2Nsb3NlIChzYXZlX2ZkKTsKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgc2F2ZV9mZCA9IGZkOwotICAgICAgICAgICAgICAgICAgICAgICAgICBzYXZlX210aW1lID0g bXRpbWU7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIHNhdmVfc3RyaW5nID0gc3RyaW5nOwot ICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAg ICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg ICAgICAvKiBXZSBzdWNjZWVkZWQ7IHJldHVybiB0aGlzIGRlc2NyaXB0b3IgYW5kIGZpbGVuYW1l LiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICBpZiAoc3RvcmVwdHIpCi0gICAgICAgICAgICAg ICAgICAgICAgICAqc3RvcmVwdHIgPSBzdHJpbmc7CisJCQkgIHNhdmVfZmQgPSBmZDsKKwkJCSAg c2F2ZV9tdGltZSA9IG10aW1lOworCQkJICBzYXZlX3N0cmluZyA9IHN0cmluZzsKKwkJCX0KKwkJ ICAgIH0KKwkJICBlbHNlCisJCSAgICB7CisJCSAgICAgIC8qIFdlIHN1Y2NlZWRlZDsgcmV0dXJu IHRoaXMgZGVzY3JpcHRvciBhbmQgZmlsZW5hbWUuICAqLworCQkgICAgICBpZiAoc3RvcmVwdHIp CisJCQkqc3RvcmVwdHIgPSBzdHJpbmc7CiAJCSAgICAgIFNBRkVfRlJFRSAoKTsKLSAgICAgICAg ICAgICAgICAgICAgICByZXR1cm4gZmQ7Ci0gICAgICAgICAgICAgICAgICAgIH0KKwkJICAgICAg cmV0dXJuIGZkOworCQkgICAgfQogCQl9CiAKLSAgICAgICAgICAgICAgLyogTm8gbW9yZSBzdWZm aXhlcy4gIFJldHVybiB0aGUgbmV3ZXN0LiAgKi8KKwkgICAgICAvKiBObyBtb3JlIHN1ZmZpeGVz LiAgUmV0dXJuIHRoZSBuZXdlc3QuICAqLwogCSAgICAgIGlmICgwIDw9IHNhdmVfZmQgJiYgISBD T05TUCAoWENEUiAodGFpbCkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg IGlmIChzdG9yZXB0cikKLSAgICAgICAgICAgICAgICAgICAgKnN0b3JlcHRyID0gc2F2ZV9zdHJp bmc7CisJCXsKKwkJICBpZiAoc3RvcmVwdHIpCisJCSAgICAqc3RvcmVwdHIgPSBzYXZlX3N0cmlu ZzsKIAkJICBTQUZFX0ZSRUUgKCk7Ci0gICAgICAgICAgICAgICAgICByZXR1cm4gc2F2ZV9mZDsK LSAgICAgICAgICAgICAgICB9CisJCSAgcmV0dXJuIHNhdmVfZmQ7CisJCX0KIAkgICAgfQogCX0K ICAgICAgIGlmIChhYnNvbHV0ZSkKQEAgLTE3NTIsOCArMTc1Miw4IEBAIHJlYWRldmFsbG9vcF9l YWdlcl9leHBhbmRfZXZhbCAoTGlzcF9PYmplY3QgdmFsLCBMaXNwX09iamVjdCBtYWNyb2V4cGFu ZCkKICAgICAgIExpc3BfT2JqZWN0IHN1YmZvcm1zID0gWENEUiAodmFsKTsKIAogICAgICAgZm9y ICh2YWwgPSBRbmls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oYyAhPSAneycpCi0gICAgICAgICAgaW52YWxpZF9zeW50YXggKCJFeHBlY3Rl ZCBvcGVuaW5nIGJyYWNlIGFmdGVyIFxcTiIpOwotICAgICAgICBjaGFyIG5hbWVbVU5JQ09ERV9D SEFSQUNURVJfTkFNRV9MRU5HVEhfQk9VTkQgKyAxXTsKLSAgICAgICAgYm9vbCB3aGl0ZXNwYWNl ID0gZmFsc2U7Ci0gICAgICAgIHB0cmRpZmZfdCBsZW5ndGggPSAwOwotICAgICAgICB3aGlsZSAo dHJ1ZSkKLSAgICAgICAgICB7Ci0gICAgICAgICAgICBjID0gUkVBRENIQVI7Ci0gICAgICAgICAg ICBpZiAoYyA8IDApCi0gICAgICAgICAgICAgIGVuZF9vZl9maWxlX2Vycm9yICgpOwotICAgICAg ICAgICAgaWYgKGMgPT0gJ30nKQotICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIGlm ICghICgwIDwgYyAmJiBjIDwgMHg4MCkpCi0gICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAg ICBBVVRPX1NUUklORyAoZm9ybWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAiSW52 YWxpZCBjaGFyYWN0ZXIgVSslMDRYIGluIGNoYXJhY3RlciBuYW1lIik7Ci0gICAgICAgICAgICAg ICAgeHNpZ25hbDEgKFFpbnZhbGlkX3JlYWRfc3ludGF4LAotICAgICAgICAgICAgICAgICAgICAg ICAgICBDQUxMTiAoRmZvcm1hdCwgZm9ybWF0LCBtYWtlX25hdG51bSAoYykpKTsKLSAgICAgICAg ICAgICAgfQotICAgICAgICAgICAgLyogVHJlYXQgbXVsdGlwbGUgYWRqYWNlbnQgd2hpdGVzcGFj ZSBjaGFyYWN0ZXJzIGFzIGEKLSAgICAgICAgICAgICAgIHNpbmdsZSBzcGFjZSBjaGFyYWN0ZXIu ICBUaGlzIG1ha2VzIGl0IGVhc2llciB0byB1c2UKLSAgICAgICAgICAgICAgIGNoYXJhY3RlciBu YW1lcyBpbiBlLmcuIG11bHRpLWxpbmUgc3RyaW5ncy4gICovCi0gICAgICAgICAgICBpZiAoY19p c3NwYWNlIChjKSkKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGlmICh3aGl0ZXNw YWNlKQotICAgICAgICAgICAgICAgICAgY29udGludWU7Ci0gICAgICAgICAgICAgICAgYyA9ICcg JzsKLSAgICAgICAgICAgICAgICB3aGl0ZXNwYWNlID0gdHJ1ZTsKLSAgICAgICAgICAgICAgfQot ICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICB3aGl0ZXNwYWNlID0gZmFsc2U7Ci0gICAg ICAgICAgICBuYW1lW2xlbmd0aCsrXSA9IGM7Ci0gICAgICAgICAgICBpZiAobGVuZ3RoID49IHNp emVvZiBuYW1lKQotICAgICAgICAgICAgICBpbnZhbGlkX3N5bnRheCAoIkNoYXJhY3RlciBuYW1l IHRvbyBsb25nIik7Ci0gICAgICAgICAgfQotICAgICAgICBpZiAobGVuZ3RoID09IDApCi0gICAg ICAgICAgaW52YWxpZF9zeW50YXggKCJFbXB0eSBjaGFyYWN0ZXIgbmFtZSIpOworCWMgPSBSRUFE Q0hBUjsKKwlpZiAoYyAhPSAneycpCisJICBpbnZhbGlkX3N5bnRheCAoIkV4cGVjdGVkIG9wZW5p bmcgYnJhY2UgYWZ0ZXIgXFxOIik7CisJY2hhciBuYW1lW1VOSUNPREVfQ0hBUkFDVEVSX05BTUVf TEVOR1RIX0JPVU5EICsgMV07CisJYm9vbCB3aGl0ZXNwYWNlID0gZmFsc2U7CisJcHRyZGlmZl90 IGxlbmd0aCA9IDA7CisJd2hpbGUgKHRydWUpCisJICB7CisJICAgIGMgPSBSRUFEQ0hBUjsKKwkg ICAgaWYgKGMgPCAwKQorCSAgICAgIGVuZF9vZl9maWxlX2Vycm9yICgpOworCSAgICBpZiAoYyA9 PSAnfScpCisJICAgICAgYnJlYWs7CisJICAgIGlmICghICgwIDwgYyAmJiBjIDwgMHg4MCkpCisJ ICAgICA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cnlfcCAodGVtKTsKLSAgICAg ICAgICBpZiAoIU5JTFAgKHRlbTEpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBpZiAo TklMUCAoRm1lbWJlciAodGVtLCBscGF0aCkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAg ICAgICAgICAgIC8qIFdlIGFyZSBydW5uaW5nIHVuaW5zdGFsbGVkLiAgVGhlIGRlZmF1bHQgbG9h ZC1wYXRoCi0gICAgICAgICAgICAgICAgICAgICBwb2ludHMgdG8gdGhlIGV2ZW50dWFsIGluc3Rh bGxlZCBsaXNwIGRpcmVjdG9yaWVzLgotICAgICAgICAgICAgICAgICAgICAgV2Ugc2hvdWxkIG5v dCB1c2UgdGhvc2Ugbm93LCBldmVuIGlmIHRoZXkgZXhpc3QsCi0gICAgICAgICAgICAgICAgICAg ICBzbyBzdGFydCBvdmVyIGZyb20gYSBjbGVhbiBzbGF0ZS4gICovCi0gICAgICAgICAgICAgICAg ICBscGF0aCA9IGxpc3QxICh0ZW0pOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0K LSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAvKiBUaGF0IGRpciBkb2Vzbid0IGV4aXN0LCBz byBhZGQgdGhlIGJ1aWxkLXRpbWUKLSAgICAgICAgICAgICAgIExpc3AgZGlycyBpbnN0ZWFkLiAg Ki8KLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZHVtcF9wYXRoID0K LSAgICAgICAgICAgICAgICBkZWNvZGVfZW52X3BhdGggKDAsIFBBVEhfRFVNUExPQURTRUFSQ0gs IDApOwotICAgICAgICAgICAgICBscGF0aCA9IG5jb25jMiAobHBhdGgsIGR1bXBfcGF0aCk7Ci0g ICAgICAgICAgICB9Ci0KLSAgICAgICAgICAvKiBBZGQgc2l0ZS1saXNwIHVuZGVyIHRoZSBpbnN0 YWxsYXRpb24gZGlyLCBpZiBpdCBleGlzdHMuICAqLwotICAgICAgICAgIGlmICghbm9fc2l0ZV9s aXNwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICB0ZW0gPSBGZXhwYW5kX2ZpbGVfbmFt ZSAoYnVpbGRfc3RyaW5nICgic2l0ZS1saXNwIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBWaW5zdGFsbGF0aW9uX2RpcmVjdG9yeSk7Ci0gICAgICAgICAgICAgIHRl bTEgPSBGZmlsZV9hY2Nlc3NpYmxlX2RpcmVjdG9yeV9wICh0ZW0pOwotICAgICAgICAgICAgICBp ZiAoIU5JTFAgKHRlbTEpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGlm IChOSUxQIChGbWVtYmVyICh0ZW0sIGxwYXRoKSkpCi0gICAgICAgICAgICAgICAgICAgIGxwYXRo ID0gRmNvbnMgKHRlbSwgbHBhdGgpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0K LQotICAgICAgICAgIC8qIElmIEVtYWNzIHdhcyBub3QgYnVpbHQgaW4gdGhlIHNvdXJjZSBkaXJl Y3RvcnksCi0gICAgICAgICAgICAgYW5kIGl0IGlzIHJ1biBmcm9tIHdoZXJlIGl0IHdhcyBidWls dCwgYWRkIHRvIGxvYWQtcGF0aAotICAgICAgICAgICAgIHRoZSBsaXNwIGFuZCBzaXRlLWxpc3Ag ZGlycyB1bmRlciB0aGF0IGRpcmVjdG9yeS4gICovCi0KLSAgICAgICAgICBpZiAoTklMUCAoRmVx dWFsIChWaW5zdGFsbGF0aW9uX2RpcmVjdG9yeSwgVnNvdXJjZV9kaXJlY3RvcnkpKSkKLSAgICAg ICAgICAgIHsKLSAgICAgICAgICAgICAgTGlzcF9PYmplY3QgdGVtMjsKLQotICAgICAgICAgICAg ICB0ZW0gPSBGZXhwYW5kX2ZpbGVfbmFtZSAoYnVpbGRfc3RyaW5nICgic3JjL01ha2VmaWxlIiks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaW5zdGFsbGF0aW9uX2Rp cmVjdG9yeSk7Ci0gICAgICAgICAgICAgIHRlbTEgPSBGZmlsZV9leGlzdHNfcCAodGVtKTsKLQot ICAgICAgICAgICAgICAvKiBEb24ndCBiZSBmb29sZWQgaWYgdGhleSBtb3ZlZCB0aGUgZW50aXJl IHNvdXJjZSB0cmVlCi0gICAgICAgICAgICAgICAgIEFGVEVSIGR1bXBpbmcgRW1hY3MuICBJZiB0 aGUgYnVpbGQgZGlyZWN0b3J5IGlzIGluZGVlZAotICAgICAgICAgICAgICAgICBkaWZmZXJlbnQg ZnJvbSB0aGUgc291cmNlIGRpciwgc3JjL01ha2VmaWxlLmluIGFuZAotICAgICAgICAgICAgICAg ICBzcmMvTWFrZWZpbGUgd2lsbCBub3QgYmUgZm91bmQgdG9nZXRoZXIuICAqLwotICAgICAgICAg ICAgICB0ZW0gPSBGZXhwYW5kX2ZpbGVfbmFtZSAoYnVpbGRfc3RyaW5nICgic3JjL01ha2VmaWxl LmluIiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWaW5zdGFsbGF0 aW9uX2RpcmVjdG9yeSk7Ci0gICAgICAgICAgICAgIHRlbTIgPSBGZmlsZV9leGlzdHNfcCAodGVt KTsKLSAgICAgICAgICAgICAgaWYgKCFOSUxQICh0ZW0xKSAmJiBOSUxQICh0ZW0yKSkKLSAgICAg ICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICB0ZW0gPSBGZXhwYW5kX2ZpbGVfbmFtZSAo YnVpbGRfc3RyaW5nICgibGlzcCIpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFZzb3VyY2VfZGlyZWN0b3J5KTsKLQotICAgICAgICAgICAgICAgICAgaWYgKE5J TFAgKEZtZW1iZXIgKHRlbSwgbHBhdGgpKSkKLSAgICAgICAgICAgICAgICAgICAgbHBhdGggPSBG Y29ucyAodGVtLCBscGF0aCk7Ci0KLSAgICAgICAgICAgICAgICAgIGlmICghbm9fc2l0ZV9saXNw KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgdGVtID0gRmV4 cGFuZF9maWxlX25hbWUgKGJ1aWxkX3N0cmluZyAoInNpdGUtbGlzcCIpLAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBWc291cmNlX2RpcmVjdG9yeSk7Ci0g ICAgICAgICAgICAgICAgICAgICAgdGVtMSA9IEZmaWxlX2FjY2Vzc2libGVfZGlyZWN0b3J5X3Ag KHRlbSk7Ci0gICAgICAgICAgICAgICAgICAgICAgaWYgKCFOSUxQICh0ZW0xKSkKLSAgICAgICAg ICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICAgICAgaWYgKE5JTFAgKEZt ZW1iZXIgKHRlbSwgbHBhdGgpKSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBscGF0aCA9 IEZjb25zICh0ZW0sIGxwYXRoKTsKLSAgICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAg ICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0gLyogVmluc3Rh bGxhdGlvbl9kaXJlY3RvcnkgIT0gVnNvdXJjZV9kaXJlY3RvcnkgKi8KLQotICAgICAgICB9IC8q IGlmIFZpbnN0YWxsYXRpb25fZGlyZWN0b3J5ICovCisJeworCSAgTGlzcF9PYmplY3QgdGVtLCB0 ZW0xOworCisJICAvKiBBZGQgdG8gdGhlIHBhdGggdGhlIGxpc3Agc3ViZGlyIG9mIHRoZSBpbnN0 YWxsYXRpb24KKwkgICAgIGRpciwgaWYgaXQgaXMgYWNjZXNzaWJsZS4gIE5vdGU6IGluIG91dC1v Zi10cmVlIGJ1aWxkcywKKwkgICAgIHRoaXMgZGlyZWN0b3J5IGlzIGVtcHR5IHNhdmUgZm9yIE1h a2VmaWxlLiAgKi8KKwkgIHRlbSA9IEZleHBhbm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icm91dGluZSBvZiBrZXltYXBfcGFuZXMuCiAgICBJdCBoYW5kbGVzIG9uZSBrZXltYXAsIEtF WU1BUC4KQEAgLTg1NywyNCArODU3LDI0IEBAIHVwZGF0ZV9zdWJtZW51X3N0cmluZ3MgKHdpZGdl dF92YWx1ZSAqZmlyc3Rfd3YpCiAgIGZvciAod3YgPSBmaXJzdF93djsgd3Y7IHd2ID0gd3YtPm5l eHQpCiAgICAgewogICAgICAgaWYgKFNUUklOR1AgKHd2LT5sbmFtZSkpCi0gICAgICAgIHsKLSAg ICAgICAgICB3di0+bmFtZSA9IFNTREFUQSAod3YtPmxuYW1lKTsKLQotICAgICAgICAgIC8qIEln bm9yZSB0aGUgQCB0aGF0IG1lYW5zICJzZXBhcmF0ZSBwYW5lIi4KLSAgICAgICAgICAgICBUaGlz IGlzIGEga2x1ZGdlLCBidXQgdGhpcyBpc24ndCB3b3J0aCBtb3JlIHRpbWUuICAqLwotICAgICAg ICAgIGlmICh3di0+dmFsdWUgPT0gKGNoYXIgKikxKQotICAgICAgICAgICAgewotICAgICAgICAg ICAgICBpZiAod3YtPm5hbWVbMF0gPT0gJ0AnKQorCXsKKwkgIHd2LT5uYW1lID0gU1NEQVRBICh3 di0+bG5hbWUpOworCisJICAvKiBJZ25vcmUgdGhlIEAgdGhhdCBtZWFucyAic2VwYXJhdGUgcGFu ZSIuCisJICAgICBUaGlzIGlzIGEga2x1ZGdlLCBidXQgdGhpcyBpc24ndCB3b3J0aCBtb3JlIHRp bWUuICAqLworCSAgaWYgKHd2LT52YWx1ZSA9PSAoY2hhciAqKTEpCisJICAgIHsKKwkgICAgICBp ZiAod3YtPm5hbWVbMF0gPT0gJ0AnKQogCQl3di0+bmFtZSsrOwotICAgICAgICAgICAgICB3di0+ dmFsdWUgPSAwOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJICAgICAgd3YtPnZhbHVlID0g MDsKKwkgICAgfQorCX0KIAogICAgICAgaWYgKFNUUklOR1AgKHd2LT5sa2V5KSk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VtcywgaSksIFF0KSkKLSAgICAgICAgewotICAgICAgICAgIHBy ZWZpeAotICAgICAgICAgICAgPSBBUkVGIChtZW51X2l0ZW1zLCBpICsgTUVOVV9JVEVNU19QQU5F X1BSRUZJWCk7Ci0gICAgICAgICAgaSArPSBNRU5VX0lURU1TX1BBTkVfTEVOR1RIOwotICAgICAg ICB9CisJeworCSAgcHJlZml4CisJICAgID0gQVJFRiAobWVudV9pdGVtcywgaSArIE1FTlVfSVRF TVNfUEFORV9QUkVGSVgpOworCSAgaSArPSBNRU5VX0lURU1TX1BBTkVfTEVOR1RIOworCX0KICAg ICAgIC8qIElnbm9yZSBhIG5pbCBpbiB0aGUgaXRlbSBsaXN0LgotICAgICAgICAgSXQncyBtZWFu aW5nZnVsIG9ubHkgZm9yIGRpYWxvZyBib3hlcy4gICovCisJIEl0J3MgbWVhbmluZ2Z1bCBvbmx5 IGZvciBkaWFsb2cgYm94ZXMuICAqLwogICAgICAgZWxzZSBpZiAoRVEgKEFSRUYgKG1lbnVfaXRl bXMsIGkpLCBRcXVvdGUpKQotICAgICAgICBpICs9IDE7CisJaSArPSAxOwogICAgICAgZWxzZQot ICAgICAgICB7Ci0gICAgICAgICAgZW50cnkKLSAgICAgICAgICAgID0gQVJFRiAobWVudV9pdGVt cywgaSArIE1FTlVfSVRFTVNfSVRFTV9WQUxVRSk7Ci0gICAgICAgICAgaWYgKGFyZWZfYWRkciAo bWVudV9pdGVtcywgaSkgPT0gY2xpZW50X2RhdGEpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgIGlmIChrZXltYXBzKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGlu dCBqOwotCi0gICAgICAgICAgICAgICAgICBlbnRyeSA9IGxpc3QxIChlbnRyeSk7Ci0gICAgICAg ICAgICAgICAgICBpZiAoIU5JTFAgKHByZWZpeCkpCi0gICAgICAgICAgICAgICAgICAgIGVudHJ5 ID0gRmNvbnMgKHByZWZpeCwgZW50cnkpOwotICAgICAgICAgICAgICAgICAgZm9yIChqID0gc3Vi bWVudV9kZXB0aCAtIDE7IGogPj0gMDsgai0tKQotICAgICAgICAgICAgICAgICAgICBpZiAoIU5J TFAgKHN1YnByZWZpeF9zdGFja1tqXSkpCi0gICAgICAgICAgICAgICAgICAgICAgZW50cnkgPSBG Y29ucyAoc3VicHJlZml4X3N0YWNrW2pdLCBlbnRyeSk7Ci0gICAgICAgICAgICAgICAgfQorCXsK KwkgIGVudHJ5CisJICAgID0gQVJFRiAobWVudV9pdGVtcywgaSArIE1FTlVfSVRFTVNfSVRFTV9W QUxVRSk7CisJICBpZiAoYXJlZl9hZGRyIChtZW51X2l0ZW1zLCBpKSA9PSBjbGllbnRfZGF0YSkK KwkgICAgeworCSAgICAgIGlmIChrZXltYXBzKQorCQl7CisJCSAgaW50IGo7CisKKwkJICBlbnRy eSA9IGxpc3QxIChlbnRyeSk7CisJCSAgaWYgKCFOSUxQIChwcmVmaXgpKQorCQkgICAgZW50cnkg PSBGY29ucyAocHJlZml4LCBlbnRyeSk7CisJCSAgZm9yIChqID0gc3VibWVudV9kZXB0aCAtIDE7 IGogPj0gMDsgai0tKQorCQkgICAgaWYgKCFOSUxQIChzdWJwcmVmaXhfc3RhY2tbal0pKQorCQkg ICAgICBlbnRyeSA9IEZjb25zIChzdWJwcmVmaXhfc3RhY2tbal0sIGVudHJ5KTsKKwkJfQogCSAg ICAgIFNBRkVfRlJFRSAoKTsKLSAgICAgICAgICAgICAgcmV0dXJuIGVudHJ5OwotICAgICAgICAg ICAgfQotICAgICAgICAgIGkgKz0gTUVOVV9JVEVNU19JVEVNX0xFTkdUSDsKLSAgICAgICAgfQor CSAgICAgIHJldHVybiBlbnRyeTsKKwkgICAgfQorCSAgaSArPSBNRU5VX0lURU1TX0lURU1fTEVO R1RIOworCX0KICAgICB9CiAgIFNBRkVfRlJFRSAoKTsKICAgcmV0dXJuIFFuaWw7CmRpZmYgLS1n aXQgYS9zcmMvbWVudS5oIGIvc3JjL21l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WluaWJ1ZmZlci1pbmFjdGl2ZS1tb2Rl IikpOwogICAgICAgZWxzZQotICAgICAgICBGa2lsbF9hbGxfbG9jYWxfdmFyaWFibGVzICgpOwor CUZraWxsX2FsbF9sb2NhbF92YXJpYWJsZXMgKCk7CiAgICAgICB1bmJpbmRfdG8gKGNvdW50LCBR bmlsKTsKICAgICB9CiAKQEAgLTE3MzgsMjMgKzE3MzgsMjMgQEAgdGhlIHZhbHVlcyBTVFJJTkcs IFBSRURJQ0FURSBhbmQgYGxhbWJkYScuICAqLykKICAgICAgIHN0cnVjdCBMaXNwX0hhc2hfVGFi bGUgKmggPSBYSEFTSF9UQUJMRSAoY29sbGVjdGlvbik7CiAgICAgICBpID0gaGFzaF9sb29rdXAg KGgsIHN0cmluZywgTlVMTCk7CiAgICAgICBpZiAoaSA+PSAwKQotICAgICAgICB7Ci0gICAgICAg ICAgdGVtID0gSEFTSF9LRVkgKGgsIGkpOwotICAgICAgICAgIGdvdG8gZm91bmRfbWF0Y2hpbmdf a2V5OwotICAgICAgICB9CisJeworCSAgdGVtID0gSEFTSF9LRVkgKGgsIGkpOworCSAgZ290byBm b3VuZF9tYXRjaGluZ19rZXk7CisJfQogICAgICAgZWxzZQogCWZvciAoaSA9IDA7IGkgPCBIQVNI X1RBQkxFX1NJWkUgKGgpOyArK2kpCi0gICAgICAgICAgewotICAgICAgICAgICAgaWYgKE5JTFAg KEhBU0hfSEFTSCAoaCwgaSkpKSBjb250aW51ZTsKLSAgICAgICAgICAgIHRlbSA9IEhBU0hfS0VZ IChoLCBpKTsKLSAgICAgICAgICAgIExpc3BfT2JqZWN0IHN0cmtleSA9IChTWU1CT0xQICh0ZW0p ID8gRnN5bWJvbF9uYW1lICh0ZW0pIDogdGVtKTsKLSAgICAgICAgICAgIGlmICghU1RSSU5HUCAo c3Rya2V5KSkgY29udGludWU7Ci0gICAgICAgICAgICBpZiAoRVEgKEZjb21wYXJlX3N0cmluZ3Mg KHN0cmluZywgUW5pbCwgUW5pbCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgc3Rya2V5LCBRbmlsLCBRbmlsLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb21wbGV0aW9uX2lnbm9yZV9jYXNlID8gUXQgOiBRbmlsKSwKLSAgICAgICAgICAgICAg ICAgICAgUXQpKQotICAgICAgICAgICAgICBnb3RvIGZvdW5kX21hdGNoaW5nX2tleTsKLSAgICAg ICAgICB9CisJICB7CisJICAgIGlmIChOSUxQIChIQVNIX0hBU0ggKGgsIGkpKSkgY29udGludWU7 CisJICAgIHRlbSA9IEhBU0hfS0VZIChoLCBpKTsKKwkgICAgTGlzcF9PYmplY3Qgc3Rya2V5ID0g KFNZTUJPTFAgKHRlbSkgPyBGc3ltYm9sX25hbWUgKHRlbSkgOiB0ZW0pOworCSAgICBpZiAoIVNU UklOR1AgKHN0cmtleSkpIGNvbnRpbnVlOworCSAgICBpZiAoRVEgKEZjb21wYXJlX3N0cmluZ3Mg KHN0cmluZywgUW5pbCwgUW5pbCwKKwkJCQkgICAgICBzdHJrZXksIFFuaWwsIFFuaWwsCisJCQkJ ICAgICAgY29tcGxldGlvbl9pZ25vcmVfY2FzZSA/IFF0IDogUW5pbCksCisJCSAgICBRdCkpCisJ ICAgICAgZ290byBmb3VuZF9tYXRjaGluZ19rZXk7CisJICB9CiAgICAgICByZXR1cm4gUW5pbDsK ICAgICBmb3VuZF9tYXRjaGluZ19rZXk6IDsKICAgICB9CkBAIC0xNzY5LDkgKzE3NjksOSBAQCB0 aGUgdmFsdWVzIFNUUklORywgUFJFRElDQVRFIGFuZCBgbGFtYmRhJy4gICovKQogICAgICAgZm9y IChyZWdleHBzID0gVmNvbXBsZXRpb25fcmVnZXhwX2xpc3Q7IENPTlNQIChyZWdleHBzKTsKIAkg ICByZWdleHBzID0gWENEUiAocmVnZXhwcykpCiAJewotICAgICAgICAgIC8qIFdlIGNhbiB0ZXN0 IGFnYWluc3QgU1RSSU5HLCB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AgICBcCiAgICAg eyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgXAogICAgICAgaWYgKG5zdHJhY2VfZW5hYmxlZCkgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgeyAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBcCi0gICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCAiJS0xMHM6JTVkOiBbJTVkXSUuKnMiLCAg ICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgICAgICAgICAgIF9fRklMRV9fLCBf X0xJTkVfXywgbnN0cmFjZV9udW0rKywgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAg ICAgICAgICAgICAyKm5zdHJhY2VfZGVwdGgsICIgIHwgfCB8IHwgfCB8IHwgfCB8IHwgfCB8IHwg fCB8IC4uIik7ICBcCi0gICAgICAgICAgZnByaW50ZiAoc3RkZXJyLCBfX1ZBX0FSR1NfXyk7ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICAgIGZwcmludGYgKHN0 ZGVyciwgIlxuIik7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwK LSAgICAgICAgfSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCisJeyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJICBmcHJpbnRmIChzdGRlcnIs ICIlLTEwczolNWQ6IFslNWRdJS4qcyIsICAgICAgICAgICAgICAgICAgICAgICAgICBcCisJCSAg IF9fRklMRV9fLCBfX0xJTkVfXywgbnN0cmFjZV9udW0rKywgICAgICAgICAgICAgICAgICAgICAg IFwKKwkJICAgMipuc3RyYWNlX2RlcHRoLCAiICB8IHwgfCB8IHwgfCB8IHwgfCB8IHwgfCB8IHwg fCAuLiIpOyAgXAorCSAgZnByaW50ZiAoc3RkZXJyLCBfX1ZBX0FSR1NfXyk7ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgXAorCSAgZnByaW50ZiAoc3RkZXJyLCAiXG4iKTsgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAorCX0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgXAog ICAgIH0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIFwKICAgd2hpbGUoMCkKIApAQCAtMjM2LDMxICsyMzYsMzEgQEAg Y2hhciBjb25zdCAqIG5zdHJhY2VfZnVsbHNjcmVlbl90eXBlX25hbWUgKGludCk7CiAKICNkZWZp bmUgTlNUUkFDRV9TSVpFKHN0cixzaXplKSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFwKICAgTlNUUkFDRV9NU0cgKHN0ciAiOiAiIE5TVFJBQ0VfRk1UX1NJWkUsICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgIE5TVFJBQ0VfQVJH X1NJWkUgKHNpemUpKTsKKwkgICAgICAgTlNUUkFDRV9BUkdfU0laRSAoc2l6ZSkpOwogCiAjZGVm aW5lIE5TVFJBQ0VfUE9JTlQoc3RyLHBvaW50KSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBcCiAgIE5TVFJBQ0VfTVNHIChzdHIgIjogIiBOU1RSQUNFX0ZNVF9QT0lOVCwg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCi0gICAgICAgICAgICAgICBOU1RSQUNFX0FS R19QT0lOVCAocG9pbnQpKT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J1ZS4gKi8KKwkJCQkgICAgICB0cnVlLiAqLwogCiAKIApAQCAt MzYzLDcgKzM2Myw3IEBAIGNoYXIgY29uc3QgKiBuc3RyYWNlX2Z1bGxzY3JlZW5fdHlwZV9uYW1l IChpbnQpOwogICAgPT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09 PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0gKi8KIEBpbnRlcmZhY2UgTlNDb2xvciAoRW1h Y3NDb2xvcikKICsgKE5TQ29sb3IgKiljb2xvckZvckVtYWNzUmVkOihDR0Zsb2F0KXJlZCBncmVl bjooQ0dGbG9hdClncmVlbgotICAgICAgICAgICAgICAgICAgICAgICAgIGJsdWU6KENHRmxvYXQp Ymx1ZSBhbHBoYTooQ0dGbG9hdClhbHBoYTsKKwkJCSBibHVlOihDR0Zsb2F0KWJsdWUgYWxwaGE6 KENHRmxvYXQpYWxwaGE7CiAtIChOU0NvbG9yICopY29sb3JVc2luZ0RlZmF1bHRDb2xvclNwYWNl OwogCiBAZW5kCkBAIC01MjIsNyArNTIyLDcgQEAgY2hhciBjb25zdCAqIG5zdHJhY2VfZnVsbHNj cmVlbl90eXBlX25hbWUgKGludCk7CiAtIChFbWFjc01lbnUgKilhZGRTdWJtZW51V2l0aFRpdGxl OiAoY29uc3QgY2hhciAqKXRpdGxlIGZvckZyYW1lOiAoc3RydWN0IGZyYW1lICopZjsKIC0gKHZv aWQpIGNsZWFyOwogLSAoTGlzcF9PYmplY3QpcnVuTWVudUF0OiAoTlNQb2ludClwIGZvckZyYW1l OiAoc3RydWN0IGZyYW1lICopZgotICAgICAgICAgICAgICAgICBrZXltYXBzOiAoYm9vbClrZXlt YXBzOworCQkga2V5bWFwczogKGJvb2wpa2V5bWFwczsKIEBlbmQKIAogCkBAIC01NTEsMTAgKzU1 MSwxMCBAQCBjaGFyIGNvbnN0ICogbnN0cmFjZV9mdWxsc2NyZWVuX3R5cGVfbmFtZSAoaW50KTsK IC0gKHZ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0IGNoYXIgKm5hbWUsCi0gICAg ICAgICAgICAgICAgICBYQ29sb3IgKmNvbG9yX2RlZiwgYm9vbCBhbGxvYywKLSAgICAgICAgICAg ICAgICAgIGJvb2wgbWFrZUluZGV4KTsKKwkJICBjb25zdCBjaGFyICpuYW1lLAorCQkgIFhDb2xv ciAqY29sb3JfZGVmLCBib29sIGFsbG9jLAorCQkgIGJvb2wgbWFrZUluZGV4KTsKIGV4dGVybiB2 b2lkCiBuc19xdWVyeV9jb2xvciAodm9pZCAqY29sLCBYQ29sb3IgKmNvbG9yX2RlZiwgaW50IHNl dFBpeGVsKTsKIApAQCAtMTE0NiwxMCArMTE0NiwxMCBAQCBleHRlcm4gdm9pZCBuc19pbml0X2xv Y2FsZSAodm9pZCk7CiBleHRlcm4gdm9pZCB1cGRhdGVfZnJhbWVfdG9vbF9iYXIgKHN0cnVjdCBm cmFtZSAqZik7CiBleHRlcm4gdm9pZCBmcmVlX2ZyYW1lX3Rvb2xfYmFyIChzdHJ1Y3QgZnJhbWUg KmYpOwogZXh0ZXJuIExpc3BfT2JqZWN0IGZpbmRfYW5kX3JldHVybl9tZW51X3NlbGVjdGlvbiAo c3RydWN0IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgYm9vbCBrZXltYXBzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgdm9pZCAqY2xpZW50X2RhdGEpOworCQkJCQkJICAgYm9vbCBr ZXltYXBzLAorCQkJCQkJICAgdm9pZCAqY2xpZW50X2RhdGEpOwogZXh0ZXJuIExpc3BfT2JqZWN0 IG5zX3BvcHVwX2RpYWxvZyAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0IGhlYWRlciwKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGNvbnRlbnRzKTsK KwkJCQkgICAgTGlzcF9PYmplY3QgY29ud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ludCByZWFkX2tiZCwKIAkgICAg ICAmJiByZXF1ZXVlZF9ldmVudHNfcGVuZGluZ19wICgpKQogCSAgICBicmVhazsKIAotICAgICAg ICAgIC8qIFRoaXMgaXMgc28gYSBicmVha3BvaW50IGNhbiBiZSBwdXQgaGVyZS4gICovCi0gICAg ICAgICAgaWYgKCF0aW1lc3BlY192YWxpZF9wICh0aW1lcl9kZWxheSkpCi0gICAgICAgICAgICAg IHdhaXRfcmVhZGluZ19wcm9jZXNzX291dHB1dF8xICgpOwotICAgICAgICB9CisJICAvKiBUaGlz IGlzIHNvIGEgYnJlYWtwb2ludCBjYW4gYmUgcHV0IGhlcmUuICAqLworCSAgaWYgKCF0aW1lc3Bl Y192YWxpZF9wICh0aW1lcl9kZWxheSkpCisJICAgICAgd2FpdF9yZWFkaW5nX3Byb2Nlc3Nfb3V0 cHV0XzEgKCk7CisJfQogCiAgICAgICAvKiBDYXVzZSBDLWcgYW5kIGFsYXJtIHNpZ25hbHMgdG8g dGFrZSBpbW1lZGlhdGUgYWN0aW9uLAogCSBhbmQgY2F1c2UgaW5wdXQgYXZhaWxhYmxlIHNpZ25h bHMgdG8gemVybyBvdXQgdGltZW91dC4KQEAgLTUxNTUsMTAgKzUxNTUsMTAgQEAgd2FpdF9yZWFk aW5nX3Byb2Nlc3Nfb3V0cHV0IChpbnRtYXhfdCB0aW1lX2xpbWl0LCBpbnQgbnNlY3MsIGludCBy ZWFkX2tiZCwKIAkgIGZkX3NldCBBdGVtcDsKIAkgIGZkX3NldCBDdGVtcDsKIAotICAgICAgICAg IGlmIChrYmRfb25faG9sZF9wICgpKQotICAgICAgICAgICAgRkRfWkVSTyAoJkF0ZW1wKTsKLSAg ICAgICAgICBlbHNlCi0gICAgICAgICAgICBjb21wdXRlX2lucHV0X3dhaXRfbWFzayAoJkF0ZW1w KTsKKwkgIGlmIChrYmRfb25faG9sZF9wICgpKQorCSAgICBGRF9aRVJPICgmQXRlbXApOworCSAg ZWxzZQorCSAgICBjb21wdXR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BiZSBs ZWZ0IGJlZm9yZSB0aGUgZ2FwLiAgKi8KICAgICAgIG1vdmVfY2FjaGVfZ2FwIChjLAotICAgICAg ICAgICAgICAgICAgICAgIChmaW5kX2NhY2hlX2JvdW5kYXJ5IChjLCAoYy0+YnVmZmVyX2JlZwot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKyBjLT5iZWdf dW5jaGFuZ2VkKSkKLSAgICAgICAgICAgICAgICAgICAgICAgKyAxKSwKLSAgICAgICAgICAgICAg ICAgICAgICAwKTsKKwkJICAgICAgKGZpbmRfY2FjaGVfYm91bmRhcnkgKGMsIChjLT5idWZmZXJf YmVnCisJCQkJCQkrIGMtPmJlZ191bmNoYW5nZWQpKQorCQkgICAgICAgKyAxKSwKKwkJICAgICAg MCk7CiAKICAgICAgIGMtPmJ1ZmZlcl9iZWcgPSBCVUZfQkVHIChidWYpOwogICAgICAgYy0+YnVm ZmVyX2VuZCA9IEJVRl9aICAgKGJ1Zik7CiAKICAgICAgIC8qIE5vdyB0aGF0IHRoZSBjYWNoZSdz IGJhc2lzIGhhcyBiZWVuIGNoYW5nZWQsIHRoZSBtb2RpZmllZAotICAgICAgICAgcmVnaW9uIGFj dHVhbGx5IHRha2VzIHVwIHNvbWUgc3BhY2UgaW4gdGhlIGNhY2hlLCBzbyB3ZSBjYW4KLSAgICAg ICAgIGludmFsaWRhdGUgaXQuICAqLworCSByZWdpb24gYWN0dWFsbHkgdGFrZXMgdXAgc29tZSBz cGFjZSBpbiB0aGUgY2FjaGUsIHNvIHdlIGNhbgorCSBpbnZhbGlkYXRlIGl0LiAgKi8KICAgICAg IHNldF9jYWNoZV9yZWdpb24gKGMsCi0gICAgICAgICAgICAgICAgICAgICAgICBjLT5idWZmZXJf YmVnICsgYy0+YmVnX3VuY2hhbmdlZCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGMtPmJ1ZmZl cl9lbmQgLSBjLT5lbmRfdW5jaGFuZ2VkLAotICAgICA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gICAgICAgZWxzZQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAv KiBXZSBkbyBuZWVkIGEgYm91bmRhcnkgaGVyZTsgY29sbGFwc2UgdGhlIHR3bwotICAgICAgICAg ICAgICAgICBib3VuZGFyaWVzIGludG8gb25lLiAgKi8KLSAgICAgICAgICAgICAgU0VUX0JPVU5E QVJZX1ZBTFVFIChjLCBtb2RpZmllZF9peCAtIDEsIHZhbHVlX2FmdGVyKTsKLSAgICAgICAgICAg ICAgZGVsZXRlX2NhY2hlX2JvdW5kYXJpZXMgKGMsIG1vZGlmaWVkX2l4LCBtb2RpZmllZF9peCAr IDEpOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJICAmJiAoQk9VTkRBUllfUE9TIChjLCBt b2RpZmllZF9peCAtIDEpCisJICAgICAgPT0gQk9VTkRBUllfUE9TIChjLCBtb2RpZmllZF9peCkp KQorCXsKKwkgIGludCB2YWx1ZV9hZnRlciA9IEJPVU5EQVJZX1ZBTFVFIChjLCBtb2RpZmllZF9p eCk7CisKKwkgIC8qIFNob3VsZCB3ZSByZW1vdmUgYm90aCBvZiB0aGUgYm91bmRhcmllcz8gIFll cywgaWYgdGhlCisJICAgICBsYXR0ZXIgYm91bmRhcnkgaXMgbm93IGVzdGFibGlzaGluZyB0aGUg c2FtZSB2YWx1ZSB0aGF0CisJICAgICB0aGUgZm9ybWVyIGJvdW5kYXJ5J3MgcHJlZGVjZXNzb3Ig ZG9lcy4gICovCisJICBpZiAobW9kaWZpZWRfaXggLSAxID4gMAorCSAgICAgICYmIHZhbHVlX2Fm dGVyID09IEJPVU5EQVJZX1ZBTFVFIChjLCBtb2RpZmllZF9peCAtIDIpKQorCSAgICBkZWxldGVf Y2FjaGVfYm91bmRhcmllcyAoYywgbW9kaWZpZWRfaXggLSAxLCBtb2RpZmllZF9peCArIDEpOwor CSAgZWxzZQorCSAgICB7CisJICAgICAgLyogV2UgZG8gbmVlZCBhIGJvdW5kYXJ5IGhlcmU7IGNv bGxhcH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CBqKTsKLSAgICAgICAgZWxzZQot ICAgICAgICAgICpuZXh0ID0gQlVGX1ogKGJ1Zik7CisJLyogU2NhbiBmb3J3YXJkIGZyb20gaSB0 byBmaW5kIHRoZSBuZXh0IGRpZmZlcmluZyBwb3NpdGlvbi4gICovCisJZm9yIChqID0gaSArIDE7 IGogPCBjLT5jYWNoZV9sZW47IGorKykKKwkgIGlmIChCT1VOREFSWV9WQUxVRSAoYywgaikgIT0g aV92YWx1ZSkKKwkgICAgYnJlYWs7CisKKwlpZiAoaiA8IGMtPmNhY2hlX2xlbikKKwkgICpuZXh0 ID0gQk9VTkRBUllfUE9TIChjLCBqKTsKKwllbHNlCisJICAqbmV4dCA9IEJVRl9aIChidWYpOwog ICAgICAgfQogCiAgICAgcmV0dXJuIGlfdmFsdWU7CkBAIC03MzYsMTUgKzczNiwxNSBAQCByZWdp b25fY2FjaGVfYmFja3dhcmQgKHN0cnVjdCBidWZmZXIgKmJ1Ziwgc3RydWN0IHJlZ2lvbl9jYWNo ZSAqYywKIAogICAgIGlmIChuZXh0KQogICAgICAgewotICAgICAgICAvKiBTY2FuIGJhY2t3YXJk IGZyb20gaSB0byBmaW5kIHRoZSBuZXh0IGRpZmZlcmluZyBwb3NpdGlvbi4gICovCi0gICAgICAg IGZvciAoaiA9IGkgLSAxOyBqID49IDA7IGotLSkKLSAgICAgICAgICBpZiAoQk9VTkRBUllfVkFM VUUgKGMsIGopICE9IGlfdmFsdWUpCi0gICAgICAgICAgICBicmVhazsKLQotICAgICAgICBpZiAo aiA+PSAwKQotICAgICAgICAgICpuZXh0ID0gQk9VTkRBUllfUE9TIChjLCBqICsgMSk7Ci0gICAg ICAgIGVsc2UKLSAgICAgICAgICAqbmV4dCA9IEJVRl9CRUcgKGJ1Zik7CisJLyogU2NhbiBiYWNr d2FyZCBmcm9tIGkgdG8gZmluZCB0aGUgbmV4dCBkaWZmZXJpbmcgcG9zaXRpb24uICAqLworCWZv ciAoaiA9IGkgLSAxOyBqID49IDA7IG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lbHQKICAgfTsK IAogc3RhdGljIHZvaWQgZG9fZGlyZWN0X3Njcm9sbGluZyAoc3RydWN0IGZyYW1lICosCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzdHJ1Y3QgbWF0cml4X2VsdCAqLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBpbnQpOworCQkJCSBzdHJ1Y3QgZ2x5cGhf bWF0cml4ICosCisJCQkJIHN0cnVjdCBtYXRyaXhfZWx0ICosCisJCQkJIGludCwgaW50KTsKIHN0 YXRpYyB2b2lkIGRvX3Njcm9sbGluZyAoc3RydWN0IGZyYW1lICosCi0gICAgICAgICAgICAgICAg ICAgICAgICAgIHN0cnVjdCBnbHlwaF9tYXRyaXggKiwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgc3RydWN0IG1hdHJpeF9lbHQgKiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgaW50LCBp bnQpOworCQkJICBzdHJ1Y3QgZ2x5cGhfbWF0cml4ICosCisJCQkgIHN0cnVjdCBtYXRyaXhfZWx0 ICosCisJCQkgIGludCwgaW50KTsKIAogDAogLyogRGV0ZXJtaW5lLCBpbiBtYXRyaXhbaSxqXSwg dGhlIGNvc3Qgb2YgdXBkYXRpbmcgdGhlIGZpcnN0IGogb2xkCkBAIC0yMzgsOCArMjM4LDggQEAg Y2FsY3VsYXRlX3Njcm9sbGluZyAoc3RydWN0IGZyYW1lICpmcmFtZSwKIAogc3RhdGljIHZvaWQK IGRvX3Njcm9sbGluZyAoc3RydWN0IGZyYW1lICpmcmFtZSwgc3RydWN0IGdseXBoX21hdHJpeCAq Y3VycmVudF9tYXRyaXgsCi0gICAgICAgICAgICAgIHN0cnVjdCBtYXRyaXhfZWx0ICptYXRyaXgs IGludCB3aW5kb3dfc2l6ZSwKLSAgICAgICAgICAgICAgaW50IHVu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gICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCwgTGlzcF9PYmplY3QsIHB0cmRpZmZfdCwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHB0cmRpZmZfdCwgaW50KTsKKwkJCSAgICAgIExpc3BfT2JqZWN0LCBMaXNwX09iamVj dCwgcHRyZGlmZl90LAorCQkJICAgICAgcHRyZGlmZl90LCBpbnQpOwogc3RhdGljIEVNQUNTX0lO VCBzZWFyY2hfYnVmZmVyIChMaXNwX09iamVjdCwgcHRyZGlmZl90LCBwdHJkaWZmX3QsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIHB0cmRpZmZfdCwgcHRyZGlmZl90LCBFTUFDU19J TlQsIGludCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QsIExp c3BfT2JqZWN0LCBib29sKTsKKwkJCQlwdHJkaWZmX3QsIHB0cmRpZmZfdCwgRU1BQ1NfSU5ULCBp bnQsCisJCQkJTGlzcF9PYmplY3QsIExpc3BfT2JqZWN0LCBib29sKTsKIAogc3RhdGljIF9Ob3Jl dHVybiB2b2lkCiBtYXRjaGVyX292ZXJmbG93ICh2b2lkKQpAQCAtMzI2LDggKzMyNiw4IEBAIGxv b2tpbmdfYXRfMSAoTGlzcF9PYmplY3Qgc3RyaW5nLCBib29sIHBvc2l4KQogCXsKIAkgIHNlYXJj aF9yZWdzLnN0YXJ0W2ldCiAJICAgID0gQllURV9UT19DSEFSIChzZWFyY2hfcmVncy5zdGFydFtp XSArIEJFR1ZfQllURSk7Ci0gICAgICAgICBzZWFyY2hfcmVncy5lbmRbaV0KLSAgICAgICAgICAg PSBCWVRFX1RPX0NIQVIgKHNlYXJjaF9yZWdzLmVuZFtpXSArIEJFR1ZfQllURSk7CisJIHNlYXJj aF9yZWdzLmVuZFtpXQorCSAgID0gQllURV9UT19DSEFSIChzZWFyY2hfcmVncy5lbmRbaV0gKyBC RUdWX0JZVEUpOwogICAg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GF5YmFj ayIsCi0gICAgICAgICAgICAgICAgICAgICAgIGVycik7CisJCSAgICAgICBlcnIpOwogCiAgIC8q IFN0YXJ0IHRoZSB0cmFuc2ZlciB3aGVuIHRoZSBidWZmZXIgaXMgYWxtb3N0IGZ1bGwgKi8KICAg ZXJyID0gc25kX3BjbV9zd19wYXJhbXNfc2V0X3N0YXJ0X3RocmVzaG9sZCAocC0+aGFuZGxlLCBw LT5zd3BhcmFtcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKGJ1ZmZlcl9zaXplIC8gcC0+cGVyaW9kX3NpemUpCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICogcC0+cGVyaW9kX3NpemUpOworCQkJCQkgICAgICAg KGJ1ZmZlcl9zaXplIC8gcC0+cGVyaW9kX3NpemUpCisJCQkJCSAgICAgICAqIHAtPnBlcmlvZF9z aXplKTsKICAgaWYgKGVyciA8IDApCiAgICAgYWxzYV9zb3VuZF9wZXJyb3IgKCJVbmFibGUgdG8g c2V0IHN0YXJ0IHRocmVzaG9sZCBtb2RlIGZvciBwbGF5YmFjayIsIGVycik7CiAKQEAgLTEwMTEs MjggKzEwMTEsMjggQEAgYWxzYV9jb25maWd1cmUgKHN0cnVjdCBzb3VuZF9kZXZpY2UgKnNkKQog ICAgICAgc25kX21peGVyX3QgKmhhbmRsZTsKICAgICAgIHNuZF9taXhlcl9lbGVtX3QgKmU7CiAg ICAgICBpZiAoc25kX21peGVyX29wZW4gKCZoYW5kbGUsIDApID49IDApCi0gICAgICAgIHsKKwl7 CiAJICBjaGFyIGNvbnN0ICpmaWxlID0gc3RyaW5nX2RlZmF1bHQgKHNkLT5maWxlLAogCQkJCQkg ICAgIERFRkFVTFRfQUxTQV9TT1VORF9ERVZJQ0UpOwotICAgICAgICAgIGlmIChzbmRfbWl4ZXJf YXR0YWNoIChoYW5kbGUsIGZpbGUpID49IDAKLSAgICAgICAgICAgICAgJiYgc25kX21peGVyX2xv YWQgKGhhbmRsZSkgPj0gMAotICAgICAgICAgICAgICAmJiBzbmRfbWl4ZXJfc2VsZW1fcmVnaXN0 ZXIgKGhhbmRsZSwgTlVMTCwgTlVMTCkgPj0gMCkKLSAgICAgICAgICAgIGZvciAoZSA9IHNuZF9t aXhlcl9maXJzdF9lbGVtIChoYW5kbGUpOwotICAgICAgICAgICAgICAgICBlOwotICAgICAgICAg ICAgICAgICBlID0gc25kX21peGVyX2VsZW1fbmV4dCAoZSkpCi0gICAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgICBpZiAoc25kX21peGVyX3NlbGVtX2hhc19wbGF5YmFja192b2x1bWUgKGUp KQotICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICBsb25nIHBtaW4sIHBt YXgsIHZvbDsKLSAgICAgICAgICAgICAgICAgICAgc25kX21peGVyX3NlbGVtX2dldF9wbGF5YmFj a192b2x1bWVfcmFuZ2UgKGUsICZwbWluLCAmcG1heCk7Ci0gICAgICAgICAgICAgICAgICAgIHZv bCA9IHBtaW4gKyAoc2QtPnZvbHVtZSAqIChwbWF4IC0gcG1pbikpIC8gMTAwOwotCi0gICAgICAg ICAgICAgICAgICAgIGZvciAoY2huID0gMDsgY2huIDw9IFNORF9NSVhFUl9TQ0hOX0xBU1Q7IGNo bisrKQotICAgICAgICAgICAgICAgICAgICAgIHNuZF9taXhlcl9zZWxlbV9zZXRfcGxheWJhY2tf dm9sdW1lIChlLCBjaG4sIHZvbCk7Ci0gICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAg IH0KLSAgICAgICAgICBzbmRfbWl4ZXJfY2xvc2UgKGhhbmRsZSk7Ci0gICAgICAgIH0KKwkgIGlm IChzbmRfbWl4ZXJfYXR0YWNoIChoYW5kbGUsIGZpbGUpID49IDAKKwkgICAgICAmJiBzbmRfbWl4 ZXJfbG9hZCAoaGFuZGxlKSA+PSAwCisJICAgICAgJiYgc25kX21peGVyX3NlbGV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yZWFrOwogCWNhc2UgQVVf RU5DT0RJTkdfSUVFRTMyOgotICAgICAgICAgIHNkLT5mb3JtYXQgPSBTTkRfUENNX0ZPUk1BVF9G TE9BVF9CRTsKLSAgICAgICAgICBicmVhazsKKwkgIHNkLT5mb3JtYXQgPSBTTkRfUENNX0ZPUk1B VF9GTE9BVF9CRTsKKwkgIGJyZWFrOwogCWNhc2UgQVVfRU5DT0RJTkdfSUVFRTY0OgogCSAgc2Qt PmZvcm1hdCA9IFNORF9QQ01fRk9STUFUX0ZMT0FUNjRfQkU7CiAJICBicmVhazsKQEAgLTExMzEs MzMgKzExMzEsMzMgQEAgYWxzYV93cml0ZSAoc3RydWN0IHNvdW5kX2RldmljZSAqc2QsIGNvbnN0 IGNoYXIgKmJ1ZmZlciwgcHRyZGlmZl90IG5ieXRlcykKIAogICAgICAgZXJyID0gc25kX3BjbV93 cml0ZWkgKHAtPmhhbmRsZSwgYnVmZmVyICsgbndyaXR0ZW4sIGZyYW1lcyk7CiAgICAgICBpZiAo ZXJyIDwgMCkKLSAgICAgICAgewotICAgICAgICAgIGlmIChlcnIgPT0gLUVQSVBFKQotICAgICAg ICAgICAgewkvKiB1bmRlci1ydW4gKi8KLSAgICAgICAgICAgICAgZXJyID0gc25kX3BjbV9wcmVw YXJlIChwLT5oYW5kbGUpOwotICAgICAgICAgICAgICBpZiAoZXJyIDwgMCkKLSAgICAgICAgICAg ICAgICBhbHNhX3NvdW5kX3BlcnJvciAoIkNhbid0IHJlY292ZXIgZnJvbSB1bmRlcnJ1biwgcHJl cGFyZSBmYWlsZWQiLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnIpOwot ICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKGVyciA9PSAtRVNUUlBJUEUpCi0gICAg ICAgICAgICB7Ci0gICAgICAgICAgICAgIHdoaWxlICgoZXJyID0gc25kX3BjbV9yZXN1bWUgKHAt PmhhbmRsZSkpID09IC1FQUdBSU4pCi0gICAgICAgICAgICAgICAgc2xlZXAgKDEpOwkvKiB3YWl0 IHVudGlsIHRoZSBzdXNwZW5kIGZsYWcgaXMgcmVsZWFzZWQgKi8KLSAgICAgICAgICAgICAgaWYg KGVyciA8IDApCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgZXJyID0gc25k X3BjbV9wcmVwYXJlIChwLT5oYW5kbGUpOwotICAgICAgICAgICAgICAgICAgaWYgKGVyciA8IDAp Ci0gICAgICAgICAgICAgICAgICAgIGFsc2Ffc291bmRfcGVycm9yICgiQ2FuJ3QgcmVjb3ZlciBm cm9tIHN1c3BlbmQsICIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICJw cmVwYXJlIGZhaWxlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl cnIpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlCi0g ICAgICAgICAgICBhbHNhX3NvdW5kX3BlcnJvciAoIkVycm9yIHdyaXRpbmcgdG8gc291bmQgZGV2 aWNlIiwgZXJyKTsKLQotICAgICAgICB9CisJeworCSAgaWYgKGVyciA9PSAtRVBJUEUpCisJICAg IHsJLyogdW5kZXItcnVuICovCisJICAgICAgZXJyID0gc25kX3BjbV9wcmVwYXJlIChwLT5oYW5k bGUpOworCSAgICAgIGlmIChlcnIgPCAwKQorCQlhbHNhX3NvdW5kX3BlcnJvciAoIkNhbid0IHJl Y292ZXIgZnJvbSB1bmRlcnJ1biwgcHJlcGFyZSBmYWlsZWQiLAorCQkJCSAgIGVycik7CisJICAg IH0KKwkgIGVsc2UgaWYgKGVyciA9PSAtRVNUUlBJUEUpCisJICAgIHsKKwkgICAgICB3aGlsZSAo KGVyciA9IHNuZF9wY21fcmVzdW1lIChwLT5oYW5kbGUpKSA9PSAtRUFHQUlOKQorCQlzbGVlcCAo MSk7CS8qIHdhaXQgdW50aWwgdGhlIHN1c3BlbmQgZmxhZy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AgKmJ5dGVwb3NfcHRyID0gZnJvbV9ieXRlOwogICAq bGFzdF9zeW50YXhfcHRyID0gU21heDsgLyogQW55IHN5bnRhY3RpYyBwb3dlciB0aGUgbGFzdCBi eXRlIGhhZCBpcwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdXNlZCB1cC4gKi8KKwkJ CSAgICAgIHVzZWQgdXAuICovCiAgIHJldHVybiAxOwogfQogCkBAIC0yNzI4LDcgKzI3MjgsNyBA QCBzY2FuX2xpc3RzIChFTUFDU19JTlQgZnJvbSwgRU1BQ1NfSU5UIGNvdW50LCBFTUFDU19JTlQg ZGVwdGgsIGJvb2wgc2V4cGZsYWcpCiAJICAgICAgZm91bmQgPSBmb3J3X2NvbW1lbnQgKGZyb20s IGZyb21fYnl0ZSwgc3RvcCwKIAkJCQkgICAgY29tbmVzdGVkLCBjb21zdHlsZSwgMCwKIAkJCQkg ICAgJm91dF9jaGFycG9zLCAmb3V0X2J5dGVwb3MsICZkdW1teSwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICZkdW1teTIpOworCQkJCSAgICAmZHVtbXkyKTsKIAkgICAgICBm cm9tID0gb3V0X2NoYXJwb3MsIGZyb21fYnl0ZSA9IG91dF9ieXRlcG9zOwogCSAgICAgIGlmICgh Zm91bmQpCiAJCXsKQEAgLTMwODMsNyArMzA4Myw3IEBAIHRoZSBwcmVmaXggc3ludGF4IGZsYWcg KHApLiAgKi8pCiAgICAgICBvcG9pbnRfYnl0ZSA9IHBvc19ieXRlOwogCiAgICAgICBpZiAocG9z IDw9IGJlZykKLSAgICAgICAgYnJlYWs7CisJYnJlYWs7CiAgICAgICBERUNfQk9USCAocG9zLCBw b3NfYnl0ZSk7CiAgICAgfQogCkBAIC0zMTU5LDkgKzMxNTksOSBAQCBkbyB7IHByZXZfZnJvbSA9 IGZyb207CQkJCVwKICAgICB7CiAgICAgICBMaXNwX09iamVjdCB0ZW1oZCA9IEZjYXIgKHRlbSk7 CiAgICAg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HhmZjsKLSAgICAgICAgICBpZiAo Y29kZSA9PSBTY29tbWVudF9mZW5jZSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgLyog UmVjb3JkIHRoZSBjb21tZW50IHN0eWxlIHdlIGhhdmUgZW50ZXJlZCBzbyB0aGF0IG9ubHkKLSAg ICAgICAgICAgICAgICAgdGhlIGNvbW1lbnQtZW5kIHNlcXVlbmNlIG9mIHRoZSBzYW1lIHN0eWxl IGFjdHVhbGx5Ci0gICAgICAgICAgICAgICAgIHRlcm1pbmF0ZXMgdGhlIGNvbW1lbnQgc2VjdGlv bi4gICovCi0gICAgICAgICAgICAgIHN0YXRlLT5jb21zdHlsZSA9IFNUX0NPTU1FTlRfU1RZTEU7 Ci0gICAgICAgICAgICAgIHN0YXRlLT5pbmNvbW1lbnQgPSAtMTsKLSAgICAgICAgICAgICAgc3Rh dGUtPmNvbXN0cl9zdGFydCA9IHByZXZfZnJvbTsKLSAgICAgICAgICAgICAgY29kZSA9IFNjb21t ZW50OwotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKGNvZGUgPT0gU2NvbW1lbnQp Ci0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHN0YXRlLT5jb21zdHlsZSA9IFNZTlRBWF9G TEFHU19DT01NRU5UX1NUWUxFIChwcmV2X2Zyb21fc3ludGF4LCAwKTsKLSAgICAgICAgICAgICAg c3RhdGUtPmluY29tbWVudCA9IChTWU5UQVhfRkxBR1NfQ09NTUVOVF9ORVNURUQgKHByZXZfZnJv bV9zeW50YXgpID8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEgOiAtMSk7Ci0g ICAgICAgICAgICAgIHN0YXRlLT5jb21zdHJfc3RhcnQgPSBwcmV2X2Zyb207Ci0gICAgICAgICAg ICB9Ci0gICAgICAgIH0KKwl7CisJICBJTkNfRlJPTTsKKwkgIGNvZGUgPSBwcmV2X2Zyb21fc3lu dGF4ICYgMHhmZjsKKwkgIGlmICh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UlRfRklSU1Qg KHByZXZfZnJvbV9zeW50YXgpCi0gICAgICAgICAgICAgICAgICAmJiAoc3ludGF4ID0gU1lOVEFY X1dJVEhfRkxBR1MgKHN5bWNoYXIpLAotICAgICAgICAgICAgICAgICAgICAgIFNZTlRBWF9GTEFH U19DT01TVEFSVF9TRUNPTkQgKHN5bnRheCkpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAg ICAgICAgICAgIHN0YXRlLT5jb21zdHlsZQotICAgICAgICAgICAgICAgICAgICA9IFNZTlRBWF9G TEFHU19DT01NRU5UX1NUWUxFIChzeW50YXgsIHByZXZfZnJvbV9zeW50YXgpOwotICAgICAgICAg ICAgICAgICAgY29tbmVzdGVkID0gKFNZTlRBWF9GTEFHU19DT01NRU5UX05FU1RFRCAocHJldl9m cm9tX3N5bnRheCkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB8IFNZTlRBWF9GTEFH U19DT01NRU5UX05FU1RFRCAoc3ludGF4KSk7Ci0gICAgICAgICAgICAgICAgICBzdGF0ZS0+aW5j b21tZW50ID0gY29tbmVzdGVkID8gMSA6IC0xOwotICAgICAgICAgICAgICAgICAgc3RhdGUtPmNv bXN0cl9zdGFydCA9IHByZXZfZnJvbTsKLSAgICAgICAgICAgICAgICAgIElOQ19GUk9NOwotICAg ICAgICAgICAgICAgICAgcHJldl9mcm9tX3N5bnRheCA9IFNtYXg7Ci0gICAgICAgICAgICAgICAg ICBjb2RlID0gU2NvbW1lbnQ7Ci0gICAgICAgICAgICAgICAgICBnb3RvIGF0Y29tbWVudDsKLSAg ICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgc3dpdGNoIChTWU5UQVggKHN5bWNoYXIp KQorCSAgICAgIGlmIChTWU5UQVhfRkxBR1NfQ09NU1RBUlRfRklSU1QgKHByZXZfZnJvbV9zeW50 YXgpCisJCSAgJiYgKHN5bnRheCA9IFNZTlRBWF9XSVRIX0ZMQUdTIChzeW1jaGFyKSwKKwkJICAg ICA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VF9TVFJJTkdfU1RZTEUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgOiAtMSk7CisJCQkgPyAo Q0hBUkFDVEVSUCAodGVtKSA/IFhGQVNUSU5UICh0ZW0pIDogU1RfU1RSSU5HX1NUWUxFKQorCQkJ IDogLTEpOwogCiAgICAgICBleHRlcm5hbCA9IEZjZHIgKGV4dGVybmFsKTsKICAgICAgIHRlbSA9 IEZjYXIgKGV4dGVybmFsKTsKICAgICAgIHN0YXRlLT5pbmNvbW1lbnQgPSAoIU5JTFAgKHRlbSkK LSAgICAgICAgICAgICAgICAgICAgICAgICAgPyAoSU5URUdFUlAgKHRlbSkgPyBYSU5UICh0ZW0p IDogLTEpCi0gICAgICAgICAgICAgICAgICAgICAgICAgIDogMCk7CisJCQkgID8gKElOVEVHRVJQ ICh0ZW0pID8gWElOVCAodGVtKSA6IC0xKQorCQkJICA6IDApOwogCiAgICAgICBleHRlcm5hbCA9 IEZjZHIgKGV4dGVybmFsKTsKICAgICAgIHRlbSA9IEZjYXIgKGV4dGVybmFsKTsKQEAgLTM0Nzks MTAgKzM0NzksMTAgQEAgaW50ZXJuYWxpemVfcGFyc2Vfc3RhdGUgKExpc3BfT2JqZWN0IGV4dGVy bmFsLCBzdHJ1Y3QgbGlzcF9wYXJzZV9zdGF0ZSAqc3RhdGUpCiAgICAgICBleHRlcm5hbCA9IEZj ZHIgKGV4dGVybmFsKTsKICAgICAgIHRlbSA9IEZjYXIgKGV4dGVybmFsKTsKICAgICAgIHN0YXRl LT5jb21zdHlsZSA9IChOSUxQICh0ZW0pCi0gICAgICAgICAgICAgICAgICAgICAgICAgPyAwCi0g ICAgICAgICAgICAgICAgICAgICAgICAgOiAoUkFOR0VEX0lOVEVHRVJQICgwLCB0ZW0sIFNUX0NP TU1FTlRfU1RZTEUpCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgPyBYSU5UICh0ZW0pCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgOiBTVF9DT01NRU5UX1NUWUxFKSk7CisJCQkgPyAw CisJCQkgOiAoUkFOR0VEX0lOVEVHRVJQICgwLCB0ZW0sIFNUX0NPTU1FTlRfU1RZTEUpCisJCQkg ICAgPyBYSU5UICh0ZW0pCisJCQkgICAgOiBTVF9DT01NRU5UX1NUWUxFKSk7CiAKICAgICAgIGV4 dGVybmFsID0gRmNkciAoZXh0ZXJuYWwpOwogICAgICAgdGVtID0gRmNhciAoZXh0ZXJuYWwpOwpA QCAtMzU3OCwxNSArMzU3OCwxNSBAQCBTaXh0aCBhcmcgQ09NTUVOVFNUT1Agbm9uLW5pbCBtZWFu cyBzdG9wIGFmdGVyIHRoZSBzdGFydCBvZiBhIGNvbW1lbnQuCiAJCQkJICA/IFFzeW50YXhfdGFi bGUKIAkJCQkgIDogbWFrZV9udW1iZXIgKHN0YXRlLmNvbXN0eWxlKSkKIAkJCSAgICAgICA6IFFu aWwpLAotCQkgICAgICAgICBGY29ucyAoKChzdGF0ZS5pbmNvbW1lbnQKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8fCAoc3RhdGUuaW5zdHJpbmcgPj0gMCkpCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICA/IG1ha2VfbnVtYmVyIChzdGF0ZS5jb21zdHJfc3RhcnQp Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IFFuaWwpLAorCQkJIEZjb25zICgo KHN0YXRlLmluY29tbWVudAorCQkJCSAgfHwgKHN0YXRlLmluc3RyaW5nID49IDApKQorCQkJCSA/ IG1ha2VfbnVtYmVyIChzdGF0ZS5jb21zdHJfc3RhcnQpCisJCQkJIDogUW5pbCksCiAJCQkgICBG Y29ucyAoc3RhdGUubGV2ZWxzdGFydHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZj b25zIChzdGF0ZS5wcmV2X3N5bnRheCA9PSBTbWF4Ci0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICA/IFFuaWwKLSAgICAgICAg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AgICAgICAgaWYgKCFidWYpCi0g ICAgICAgICAgICByZXR1cm4gTlVMTDsKLSAgICAgICAgfQorCXsKKwkgIGlmIChnZXRjd2QgKGJ1 ZiwgYnVmX3NpemUpID09IGJ1ZikKKwkgICAgYnJlYWs7CisJICBpZiAoZXJybm8gIT0gRVJBTkdF KQorCSAgICB7CisJICAgICAgaW50IHRtcF9lcnJubyA9IGVycm5vOworCSAgICAgIGZyZWUgKGJ1 Zik7CisJICAgICAgZXJybm8gPSB0bXBfZXJybm87CisJICAgICAgcmV0dXJuIE5VTEw7CisJICAg IH0KKwkgIGJ1Zl9zaXplICo9IDI7CisJICBidWYgPSByZWFsbG9jIChidWYsIGJ1Zl9zaXplKTsK KwkgIGlmICghYnVmKQorCSAgICByZXR1cm4gTlVMTDsKKwl9CiAgICAgfQogICByZXR1cm4gYnVm OwogfQpAQCAtMjk0LDExICsyOTQsMTEgQEAgZGlzY2FyZF90dHlfaW5wdXQgKHZvaWQpCiAgICAg c3RydWN0IHR0eV9kaXNwbGF5X2luZm8gKnR0eTsKICAgICBmb3IgKHR0eSA9IHR0eV9saXN0OyB0 dHk7IHR0eSA9IHR0eS0+bmV4dCkKICAgICAgIHsKLSAgICAgICAgaWYgKHR0eS0+aW5wdXQpICAg ICAgICAgLyogSXMgdGhlIGRldmljZSBzdXNwZW5kZWQ/ICovCi0gICAgICAgICAgewotICAgICAg ICAgICAgZW1hY3NfZ2V0X3R0eSAoZmlsZW5vICh0dHktPmlucHV0KSwgJmJ1Zik7Ci0gICAgICAg ICAgICBlbWFjc19zZXRfdHR5IChmaWxlbm8gKHR0eS0+aW5wdXQpLCAmYnVmLCAwKTsKLSAgICAg ICAgICB9CisJaWYgKHR0eS0+aW5wdXQpICAgICAgICAgLyogSXMgdGhlIGRldmljZSBzdXNwZW5k ZWQ/ICovCisJICB7CisJICAgIGVtYWNzX2dldF90dHkgKGZpbGVubyAodHR5LT5pbnB1dCksICZi dWYpOworCSAgICBlbWFjc19zZXRfdHR5IChm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GTCwKLSAgICAgICAgIGZjbnRsIChmaWxlbm8gKHR0eV9vdXQtPmlucHV0 KSwgRl9HRVRGTCwgMCkgJiB+T19OT05CTE9DSyk7CisJIGZjbnRsIChmaWxlbm8gKHR0eV9vdXQt PmlucHV0KSwgRl9HRVRGTCwgMCkgJiB+T19OT05CTE9DSyk7CiAjZW5kaWYKIAogICBpZiAodHR5 X291dC0+b2xkX3R0eSkKICAgICB3aGlsZSAoZW1hY3Nfc2V0X3R0eSAoZmlsZW5vICh0dHlfb3V0 LT5pbnB1dCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgIHR0eV9vdXQtPm9sZF90dHksIDAp IDwgMCAmJiBlcnJubyA9PSBFSU5UUikKKwkJCSAgdHR5X291dC0+b2xkX3R0eSwgMCkgPCAwICYm IGVycm5vID09IEVJTlRSKQogICAgICAgOwogCiAjaWZkZWYgTVNET1MJLyogRGVtYWNzIDEuMS4y IDkxLzEwLzIwIE1hbmFidSBIaWdhc2hpZGEgKi8KZGlmZiAtLWdpdCBhL3NyYy90ZXJtLmMgYi9z cmMvdGVybS5jCmluZGV4IGQ2OTFhN2EuLjkyMDJhYmMgMTAwNjQ0Ci0tLSBhL3NyYy90ZXJtLmMK KysrIGIvc3JjL3Rlcm0uYwpAQCAtODIsOCArODIsOCBAQCBzdGF0aWMgX05vcmV0dXJuIHZvaWQg dmZhdGFsIChjb25zdCBjaGFyICpzdHIsIHZhX2xpc3QgYXApCiAKICNkZWZpbmUgT1VUUFVUKHR0 eSwgYSkgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBcCiAgIGVtYWNz X3RwdXRzICgodHR5KSwgYSwgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg XAotICAgICAgICAgICAgICAgRlJBTUVfVE9UQUxfTElORVMgKFhGUkFNRSAoc2VsZWN0ZWRfZnJh bWUpKSAtIGN1clkgKHR0eSksCVwKLSAgICAgICAgICAgICAgIGNtcHV0YykKKwkgICAgICAg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Y2UgZm9yIHRoZSB0ZXJtaW5h bCBmcmFtZSBvZiBYLXdpbmRvd3MgZW1hY3MsIGJ1dCBub3QKKwkgdXNlZCBhZnRlcndhcmRzLgog Ci0gICAgICAgICBjaGFyX2luc19kZWxfdmVjdG9yIChpLmUuLCBjaGFyX2luc19kZWxfY29zdCkg aXNuJ3QgdXNlZCBiZWNhdXNlCi0gICAgICAgICBYIHR1cm5zIG9mZiBjaGFyX2luc19kZWxfb2su ICovCisJIGNoYXJfaW5zX2RlbF92ZWN0b3IgKGkuZS4sIGNoYXJfaW5zX2RlbF9jb3N0KSBpc24n dCB1c2VkIGJlY2F1c2UKKwkgWCB0dXJucyBvZmYgY2hhcl9pbnNfZGVsX29rLiAqLwogCiAgICAg ICBtYXhfZnJhbWVfY29scyA9IG1heCAobWF4X2ZyYW1lX2NvbHMsIEZSQU1FX0NPTFMgKGZyYW1l KSk7CiAgICAgICBpZiAoKG1pbiAoUFRSRElGRl9NQVgsIFNJWkVfTUFYKSAvIHNpemVvZiAoaW50 KSAtIDEpIC8gMgpAQCAtMTE4MywyMyArMTE4MywyMyBAQCBjYWxjdWxhdGVfY29zdHMgKHN0cnVj dCBmcmFtZSAqZnJhbWUpCiAKIAogICAgICAgaWYgKGYgJiYgKCF0dHktPlRTX2luc19saW5lICYm ICF0dHktPlRTX2RlbF9saW5lKSkKLSAgICAgICAgZG9fbGluZV9pbnNlcnRpb25fZGVsZXRpb25f Y29zdHMgKGZyYW1lLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg dHR5LT5UU19yZXZfc2Nyb2xsLCB0dHktPlRTX2luc19tdWx0aV9saW5lcywKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0eS0+VFNfZndkX3Njcm9sbCwgdHR5LT5U U19kZWxfbXVsdGlfbGluZXMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBmLCBmLCAxKTsKKwlkb19saW5lX2luc2VydGlvbl9kZWxldGlvbl9jb3N0cyAoZnJhbWUs CisJCQkJCSAgdHR5LT5UU19yZXZfc2Nyb2xsLCB0dHktPlRTX2luc19tdWx0aV9saW5lcywKKwkJ CQkJICB0dHktPlRTX2Z3ZF9zY3JvbGwsIHR0eS0+VFNfZGVsX211bHRpX2xpbmVzLAorCQkJCQkg IGYsIGYsIDEpOwogICAgICAgZWxzZQotICAgICAgICBkb19saW5lX2luc2VydGlvbl9kZWxldGlv bl9jb3N0cyAoZnJhbWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICB0dHktPlRTX2luc19saW5lLCB0dHktPlRTX2luc19tdWx0aV9saW5lcywKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHR0eS0+VFNfZGVsX2xpbmUsIHR0eS0+VFNf ZGVsX211bHRpX2xpbmVzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgMCwgMCwgMSk7CisJZG9fbGluZV9pbnNlcnRpb25fZGVsZXRpb25fY29zdHMgKGZyYW1lLAor CQkJCQkgIHR0eS0+VFNfaW5zX2xpbmUsIHR0eS0+VFNfaW5zX211bHRpX2xpbmVzLAorCQkJCQkg IHR0eS0+VFNfZGVsX2xpbmUsIHR0eS0+VFNfZGVsX211bHRpX2xpbmVzLAorCQkJCQkgIDAsIDAs IDEpOwogCiAgICAgICBjYWxjdWxhdGVfaW5zX2RlbF9jaGFyX2Nvc3RzIChmcmFtZSk7CiAKICAg ICAgIC8qIERvbid0IHVzZSBUU19yZXBlYXQgaWYgaXRzIHBhZGRpbmcgaXMgd29yc2UgdGhhbiBz ZW5kaW5nIHRoZSBjaGFycyAqLwogICAgICAgaWYgKHR0eS0+VFNfcmVwZWF0ICYmIHBlcl9saW5l X2Nvc3QgKHR0eS0+VFNfcmVwZWF0KSAqIGJhdWRfcmF0ZSA8IDkwMDApCi0gICAgICAgIHR0eS0+ UlBvdiA9IHN0c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aW4vc3Rkb3V0LiAqLwogICBjaGFyICp0eXBlOyAg ICAgICAgICAgICAgICAgICAvKiBUaGUgdHlwZSBvZiB0aGUgdHR5LiAqLwogCiAgIC8qIElucHV0 L291dHB1dCAqLwogCiAgIEZJTEUgKmlucHV0OyAgICAgICAgICAgICAgICAgIC8qIFRoZSBzdHJl YW0gdG8gYmUgdXNlZCBmb3IgdGVybWluYWwgaW5wdXQuCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIE5VTEwgaWYgdGhlIHRlcm1pbmFsIGlzIHN1c3BlbmRlZC4gKi8KKwkJCQkg ICBOVUxMIGlmIHRoZSB0ZXJtaW5hbCBpcyBzdXNwZW5kZWQuICovCiAgIEZJTEUgKm91dHB1dDsg ICAgICAgICAgICAgICAgIC8qIFRoZSBzdHJlYW0gdG8gYmUgdXNlZCBmb3IgdGVybWluYWwgb3V0 cHV0LgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMIGlmIHRoZSB0ZXJt aW5hbCBpcyBzdXNwZW5kZWQuICovCisJCQkJICAgTlVMTCBpZiB0aGUgdGVybWluYWwgaXMgc3Vz cGVuZGVkLiAqLwogCiAgIEZJTEUgKnRlcm1zY3JpcHQ7ICAgICAgICAgICAgIC8qIElmIG5vbnpl cm8sIHNlbmQgYWxsIHRlcm1pbmFsIG91dHB1dAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBjaGFyYWN0ZXJzIHRvIHRoaXMgc3RyZWFtIGFsc28uICAqLworCQkJCSAgIGNoYXJh Y3RlcnMgdG8gdGhpcyBzdHJlYW0gYWxzby4gICovCiAKICAgc3RydWN0IGVtYWNzX3R0eSAqb2xk X3R0eTsgICAgLyogVGhlIGluaXRpYWwgdHR5IG1vZGUgYml0cyAqLwogCkBAIC02NCw3ICs2NCw3 IEBAIHN0cnVjdCB0dHlfZGlzcGxheV9pbmZvCiAgIGludCByZWZlcmVuY2VfY291bnQ7ICAgICAg ICAgIC8qI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OiBfIHVuZGVybGluZXMgaWYgb3Zlci1zdHJ1Y2sgb24KLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgbm9uLWJsYW5rIHBvc2l0aW9uLiAgTXVzdCBjbGVhciBiZWZv cmUgd3JpdGluZyBfLiAgKi8KKwkJCQkgICBub24tYmxhbmsgcG9zaXRpb24uICBNdXN0IGNsZWFy IGJlZm9yZSB3cml0aW5nIF8uICAqLwogICBpbnQgVEZfdGVsZXJheTsgICAgICAgICAgICAgICAv KiB0ZXJtY2FwIHh0IGZsYWc6IG1hbnkgd2VpcmQgY29uc2VxdWVuY2VzLgotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBGb3IgdDEwNjEuICovCisJCQkJICAgRm9yIHQxMDYxLiAq LwogCiAgIGludCBSUG92OyAgICAgICAgICAgICAgICAgICAgIC8qICMgY2hhcnMgdG8gc3RhcnQg YSBUU19yZXBlYXQgKi8KIApkaWZmIC0tZ2l0IGEvc3JjL3Rlcm1ob29rcy5oIGIvc3JjL3Rlcm1o b29rcy5oCmluZGV4IDgxZTA2ZDkuLmM0MzY4ZDYgMTAwNjQ0Ci0tLSBhL3NyYy90ZXJtaG9va3Mu aAorKysgYi9zcmMvdGVybWhvb2tzLmgKQEAgLTExOCw4ICsxMTgsOCBAQCBlbnVtIGV2ZW50X2tp bmQKIAkJCQkgICAudGltZXN0YW1wIGdpdmVzIGEgdGltZXN0YW1wIChpbgogCQkJCSAgIG1pbGxp c2Vjb25kcykgZm9yIHRoZSBldmVudC4gICovCiAgIEhPUklaX1dIRUVMX0VWRU5ULCAgICAgICAg ICAgIC8qIEEgd2hlZWwgZXZlbnQgZ2VuZXJhdGVkIGJ5IGEgc2Vjb25kCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGhvcml6b250YWwgd2hlZWwgdGhhdCBpcyBwcmVzZW50IG9u IHNvbWUKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbWljZS4gU2V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Ugd2FzIGF0IHRoZSByZXR1cm5lZCBwb3NpdGlvbi4gICovCiAg IHZvaWQgKCptb3VzZV9wb3NpdGlvbl9ob29rKSAoc3RydWN0IGZyYW1lICoqZiwgaW50LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0ICpiYXJfd2luZG93LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVudW0gc2Nyb2xsX2Jhcl9wYXJ0ICpwYXJ0LAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0ICp4LAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0ICp5LAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIFRpbWUgKik7CisJCQkgICAgICAgTGlzcF9PYmplY3QgKmJhcl93aW5kb3cs CisJCQkgICAgICAgZW51bSBzY3JvbGxfYmFyX3BhcnQgKnBhcnQsCisJCQkgICAgICAgTGlzcF9P YmplY3QgKngsCisJCQkgICAgICAgTGlzcF9PYmplY3QgKnksCisJCQkgICAgICAgVGltZSAqKTsK IAogICAvKiBXaGVuIGEgZnJhbWUncyBmb2N1cyByZWRpcmVjdGlvbiBpcyBjaGFuZ2VkLCB0aGlz IGhvb2sgdGVsbHMgdGhlCiAgICAgIHdpbmRvdyBzeXN0ZW0gY29kZSB0byByZS1kZWNpZGUgd2hl cmUgdG8gcHV0IHRoZSBoaWdobGlnaHQuICBVbmRlcgpAQCAtNTYxLDggKzU2MSw4IEBAIHN0cnVj dCB0ZXJtaW5hbAogICAgICBvZiBXSE9MRSBjaGFyYWN0ZXJzLCBzdGFydGluZyBhdCBQT1NJVElP Ti4gIElmIFdJTkRPVyBkb2Vzbid0IHlldAogICAgICBoYXZlIGEgc2Nyb2xsIGJhciwgY3JlYXRl IG9uZSBmb3IgaXQuICAqLwogICB2b2lkICgqc2V0X3ZlcnRpY2FsX3Njcm9sbF9iYXJfaG9vaykg KHN0cnVjdCB3aW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pZmYgLS1naXQgYS9zcmMvdGV4dHByb3AuYyBiL3NyYy90ZXh0cHJvcC5jCmluZGV4 IDdhZjhjNjkuLjhmNzY4NzEgMTAwNjQ0Ci0tLSBhL3NyYy90ZXh0cHJvcC5jCisrKyBiL3NyYy90 ZXh0cHJvcC5jCkBAIC0xNzEzLDE4ICsxNzEzLDE4IEBAIFJldHVybiB0IGlmIGFueSBwcm9wZXJ0 eSB3YXMgYWN0dWFsbHkgcmVtb3ZlZCwgbmlsIG90aGVyd2lzZS4gICovKQogICAgICAgbGVuIC09 IExFTkdUSCAoaSk7CiAgICAgICBpID0gbmV4dF9pbnRlcnZhbCAoaSk7CiAgICAgICBpZiAoIWkp Ci0gICAgICAgIHsKLSAgICAgICAgICBpZiAobW9kaWZpZWQpCi0gICAgICAgICAgICB7Ci0gICAg ICAgICAgICAgIGlmIChCVUZGRVJQIChvYmplY3QpKQotICAgICAgICAgICAgICAgIHNpZ25hbF9h ZnRlcl9jaGFuZ2UgKFhJTlQgKHN0YXJ0KSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBYSU5UIChlbmQpIC0gWElOVCAoc3RhcnQpLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFhJTlQgKGVuZCkgLSBYSU5UIChzdGFydCkpOwotICAgICAgICAgICAg ICByZXR1cm4gUXQ7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZQotICAgICAgICAgICAg cmV0dXJuIFFuaWw7Ci0gICAgICAgIH0KKwl7CisJICBpZiAobW9kaWZpZWQpCisJICAgIHsKKwkg ICAgICBpZiAoQlVGRkVSUCAob2JqZWN0KSkKKwkJc2lnbmFsX2FmdGVyX2NoYW5nZSAoWElOVCAo c3RhcnQpLAorCQkJCSAgICAgWElOVCAoZW5kKSAtIFhJTlQgKHN0YXJ0KSwKKwkJCQkgICAgIFhJ TlQgKGVuZCkgLSBYSU5UIChzdGFydCkpOworCSAgICAgIHJldHVybiBRdDsK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8gdGhlIGNvcnJlY3QgcG9zaXRpb24uICAqLwotICAgICAgICAg IGFkanVzdG1lbnQgPSAobS0+aW5zZXJ0aW9uX3R5cGUgPyB0byA6IGZyb20pIC0gY2hhcnBvczsK LQotICAgICAgICAgIGlmIChhZGp1c3RtZW50KQotICAgICAgICAgICAgewotICAgICAgICAgICAg ICBYU0VUTUlTQyAobWFya2VyLCBtKTsKLSAgICAgICAgICAgICAgYnNldF91bmRvX2xpc3QKLSAg ICAgICAgICAgICAgICAoY3VycmVudF9idWZmZXIsCi0gICAgICAgICAgICAgICAgIEZjb25zIChG Y29ucyAobWFya2VyLCBtYWtlX251bWJlciAoYWRqdXN0bWVudCkpLAotICAgICAgICAgICAgICAg ICAgICAgICAgQlZBUiAoY3VycmVudF9idWZmZXIsIHVuZG9fbGlzdCkpKTsKLSAgICAgICAgICAg IH0KLSAgICAgICAgfQorCXsKKwkgIC8qIGluc2VydGlvbl90eXBlIG5pbCBtYXJrZXJzIHdpbGwg ZW5kIHVwIGF0IHRoZSBiZWdpbm5pbmcgb2YKKwkgICAgIHRoZSByZS1pbnNlcnRlZCB0ZXh0IGFm dGVyIHVuZG9pbmcgYSBkZWxldGlvbiwgYW5kIG11c3QgYmUKKwkgICAgIGFkanVzdGVkIHRvIG1v dmUgdGhlbSB0byB0aGUgY29ycmVjdCBwbGFjZS4KKworCSAgICAgaW5zZXJ0aW9uX3R5cGUgdCBt YXJrZXJzIHdpbGwgYXV0b21hdGljYWxseSBtb3ZlIGZvcndhcmQKKwkgICAgIHVwb24gcmUtaW5z ZXJ0aW5nIHRoZSBkZWxldGVkIHRleHQsIHNvIHdlIGhhdmUgdG8gYXJyYW5nZQorCSAgICAgZm9y IHRoZW0gdG8gbW92ZSBiYWNrd2FyZCB0byB0aGUgY29ycmVjdCBwb3NpdGlvbi4gICovCisJICBh ZGp1c3RtZW50ID0gKG0tPmluc2VydGlvbl90eXBlID8gdG8gOiBmcm9tKSAtIGNoYXJwb3M7CisK KwkgIGlmIChhZGp1c3RtZW50KQorCSAgICB7CisJICAgICAgWFNFVE1JU0MgKG1hcmtlciwgbSk7 CisJICAgICAgYnNldF91bmRvX2xpc3QKKwkJKGN1cnJlbnRfYnVmZmVyLAorCQkgRmNvbnMgKEZj b25zIChtYXJrZXIsIG1ha2VfbnVtYmVyIChhZGp1c3RtZW50KSksCisJCQlCVkFSIChjdXJyZW50 X2J1ZmZlciwgdW5kb19saXN0KSkpOworCSAgICB9CisJfQogICAgIH0KIH0KIApkaWZmIC0tZ2l0 IGEvc3JjL3VuZXhhaXguYyBiL3NyYy91bmV4YWl4LmMKaW5kZXggYzIwMTJmNy4uNTNlOGZkMSAx MDA2NDQKLS0tIGEvc3JjL3VuZXhhaXguYworKysgYi9zcmMvdW5leGFpeC5jCkBAIC0yMjYsMTEg KzIyNiwxMSBAQCBtYWtlX2hkciAoaW50IG5ldywgaW50IGFfb3V0LAogICBpZiAoc3RyY21wIChz LT5zX25hbWUsIG5hbWUpID09IDApIHsgXAogICAgIGlmIChzLT5zX2ZsYWdzICE9IGZsYWdzKSB7 IFwKICAgICAgIGZwcmludGYgKHN0ZGVyciwgInVuZXhlYzogJWx4IGZsYWdzIHdoZXJlICV4IGV4 cGVjdGVkIGluICVzIHNlY3Rpb24uXG4iLCBcCi0gICAgICAgICAgICAgICAodW5zaWduZWQgbG9u ZylzLT5zX2ZsYWdzLCBmbGFncywgbmFtZSk7ICAgICAgICAgICAgICAgICBcCisJICAgICAgICh1 bnNpZ25lZCBsb25nKXMtPnNfZmxhZ3MsIGZsYWdzLCBuYW1lKTsgICAgICAgICAgICAgICAgIFwK ICAgICB9IFwKICAgICBpZiAocHRyKSB7IFwKICAgICAgIGZwcmludGYgKHN0ZGVyciwgInVuZXhl YzogZHVwbGljYXRlIHNlY3Rpb24gaGVhZGVyIGZvciBzZWN0aW9uICVzLlxuIiwgXAotICAgICAg ICAgICAgICAgbmFtZSk7ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXAorCSAgICAgICBuYW1lKTsgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBcCiAgICAgfSBcCiAgICAgcHRyID0gczsgXAogICB9CkBAIC00 OTgsMTIgKzQ5OCwxMiBAQCBhZGp1c3RfbG5ub3B0cnMgKGludCB3cml0ZWRlc2MsIGludCByZWFk ZGVzYywgY29uc3QgY2hhciAqbmV3X25hbWUpCiAJICByZWFkIChuZXcsICZhdXhlbnRyeSwgQVVY RVNaKTsKIAkgIG5zeW1zKys7CiAJICBpZiAobmF1eCAhPSAwICAgICAgICAgICAgICAvKiBza2lw IGNzZWN0IGF1eGVudHJ5IChsYXN0IGVudHJ5KSAqLwotICAgICAgICAgICAgICAmJiAoc3ltZW50 cnkubl9zY2xhc3MgPT0gQ19FWFQgfHwgc3ltZW50cnkubl9zY2xhc3MgPT0gQ19ISURFWFQpKQot ICAgICAgICAgICAgewotICAgICAgICAgICAgICBhdXhlbnRyeS54X3N5bS54X2ZjbmFyeS54X2Zj bi54X2xubm9wdHIgKz0gYmlhczsKLSAgICAgICAgICAgICAgbHNlZWsgKG5ldywgLUFVWEVTWiwg U0VFS19DVVIpOwotICAgICAgICAgICAgICB3cml0ZSAobmV3LCAmYXV4ZW50cnksIEFVWEVTWik7 Ci0gICAgICAgICAgICB9CisJICAgICAgJiYgKHN5bWVudHJ5Lm5fc2NsYXNzID09IENfRVhUIHx8 IHN5bWVudHJ5Lm5fc2NsYXNzID09IENfSElERVhUKSkKKwkgICAgeworCSAgICAgIGF1eGVudHJ5 Lnhfc3ltLnhfZmNuYXJ5LnhfZmNuLnhfbG5ub3B0ciArPSBiaWFzOworCSAgICAgIGxzZWVrIChu ZXcsIC1BVVhFU1osIFNFRUtfQ1VSKTsKKwkgICAgICB3cml0ZSAobmV3LCAmYXV4ZW50cnksIEFV WEVTWik7CisJICAgIH0KIAl9CiAgICAgfQogICBlbWFjc19jbG9zZSAobmV3KTsKQEAgLTU3Miw3 ICs1NzIsNyBAQCB1bnJlbG9jYXRlX3N5bWJvbHMgKGludCBuZXcsIGludCBhX291dCwKIAkgIGlu dCBvcmlnX2ludDsKIAogCSAgbHNlZWsgKGFfb3V0LAotICAgICAgICAgICAgICAgICBvcmlnX2Rh dGFfc2NucHRyICsgKGxkcmVsLmxfdmFkZHIgLSBmX29oZHIuZGF0YV9zdGFydCksCisJCSBvcmln X2RhdGFfc2NucHRyICsgKGxkcmVsLmxfdmFkZHIgLSBmX29oZHIuZGF0YV9zdGFydCksCiAJCSBT RUVLX1NFVCk7CiAKIAkgIGlmIChyZWFkIChhX291dCwgKHZvaWQgKikgJm9yaWdfaW50LCBzaXpl b2YgKG9yaWdfaW50KSkKQEAgLTU4MSw3ICs1ODEsNyBAQCB1bnJlbG9jYXRlX3N5bWJvbHMgKGlu dCBuZXcsIGludCBhX291dCwKIAkgICAgICBQRVJST1IgKGFfbmFtZSk7CiAJICAgIH0KIAotICAg ICAgICAgIHAgPSAoaW50ICopIChpbnRwdHJfdCkgKGxkcmVsLmxfdmFkZHIgKyBkX3JlbG9jKTsK KwkgIHAgPSAoaW50ICopIChpbnRwdHJfdCkgKGxkcmVsLmxfdmFkZHIgKyBkX3JlbG9jKTsKIAog CSAgc3dpdGNoIChsZHJlbC5sX3N5bW5keCkgewogCSAgY2FzZSBTWU1ORFhfVEVYVDoKQEAgLTU5 NCwxNyArNTk0LDE3IEBAIHVucmVsb2NhdGVfc3ltYm9scyAoaW50IG5ldywgaW50IGFfb3V0LAog CSAgICBicmVhazsKIAkgIH0KIAotICAgICAgICAgIGlmIChvcmlnX2ludCAhPSAqIHApCi0gICAg ICAgICAgICB7Ci0gICAgICAgICAgICAgIGxzZWVrIChuZXcsCi0gICAgICAgICAgICAgICAgICAg ICBkYXRhX3NjbnB0ciArIChsZHJlbC5sX3ZhZGRyIC0gZl9vaGRyLmRhdGFfc3RhcnQpLAorCSAg aWYgKG9yaWdfaW50ICE9ICogcCkKKwkgICAgeworCSAgICAgIGxzZWVrIChuZXcsCisJCSAgICAg ZGF0YV9zY25wdHIgKyAobGRyZWwubF92YWRkciAtIGZfb2hkci5kYXRhX3N0YXJ0KSwKIAkJICAg ICBTRUVLX1NFVCk7Ci0gICAgICAgICAgICAgIGlmICh3cml0ZSAobmV3LCAodm9pZCAqKSAmb3Jp Z19pbnQsIHNpemVvZiAob3JpZ19pbnQpKQotICAgICAgICAgICAgICAgICAgIT0gc2l6ZW9mIChv cmlnX2ludCkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgUEVSUk9SIChu ZXdfbmFtZSk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQorCSAgICAgIGlmICh3 cml0ZSAobmV3LCAodm9pZCAqKSAmb3JpZ19pbnQsIHNpemVvZiAob3JpZ19pbnQpKQorCQkgICE9 IHNpemVvZiAob3JpZ19pbnQpKQorCQl7CisJCSAgUEVSUk9SIChuZXdfbmFtZSk7CisJCX0KKwkg ICAgfQogCX0KICAgICB9CiAgIHJldHVybiAwOwpkaWZmIC0tZ2l0IGEvc3JjL3VuZXhjb2ZmLmMg Yi9zcmMvdW5leGNvZmYuYwppbmRleCA2YTA4MzgwLi40NTQwYWJlIDEwMDY0NAotLS0gYS9zcmMv dW5leGNvZmYuYworKysgYi9zcmMvdW5leGNvZmYuYwpAQCAtMjMwLDcgKzIzMCw3IEBAIG1ha2Vf aGRyIChpbnQgbmV3LCBpbnQgYV9vdXQsCiAJICB9CiAJaWYgKHNjbnRlbXAuc19zY25wdHIgPiAw TCkKIAkgIHsKLSAgICAgICAgICAgIGlmIChibG9ja19jb3B5X3N0YXJ0IDwgc2NudGVtcC5zX3Nj bnB0ciArIHNjbnRlbXAuc19zaXplKQorCSAgICBpZiAoYmxvY2tfY29weV9zdGFydCA8IHNjbnRl bXAuc19zY25wdHIgKyBzY250ZW1wLnNfc2l6ZSkKIAkgICAgICBibG9ja19jb3B5X3N0YXJ0ID0g c2NudGVtcC5zX3NjbnB0ciArIHNjbnR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c2UgYSBmaWxlIGNhY2hlIGZvciBzcGFyc2UKLSAg ICAgICAgICAgICAgICogZXhlY3V0YWJsZXMsIHNvIGlmIHdlIGJvb3RzdHJhcCBFbWFjcyB1c2lu ZyBhIHNwYXJzZQotICAgICAgICAgICAgICAgKiBib290c3RyYXAtZW1hY3MuZXhlLCBib290c3Ry YXAgdGFrZXMgYWJvdXQgdHdlbnR5Ci0gICAgICAgICAgICAgICAqIHRpbWVzIGxvbmdlciB0aGFu IGl0IHdvdWxkIG90aGVyd2lzZS4gICovCisJICAgICAgLyogTWFrZSBzdXJlIHRoZSBnZW5lcmF0 ZWQgYm9vdHN0cmFwIGJpbmFyeSBpc24ndAorCSAgICAgICAqIHNwYXJzZS4gIE5UIGRvZXNuJ3Qg dXNlIGEgZmlsZSBjYWNoZSBmb3Igc3BhcnNlCisJICAgICAgICogZXhlY3V0YWJsZXMsIHNvIGlm IHdlIGJvb3RzdHJhcCBFbWFjcyB1c2luZyBhIHNwYXJzZQorCSAgICAgICAqIGJvb3RzdHJhcC1l bWFjcy5leGUsIGJvb3RzdHJhcCB0YWtlcyBhYm91dCB0d2VudHkKKwkgICAgICAgKiB0aW1lcyBs b25nZXIgdGhhbiBpdCB3b3VsZCBvdGhlcndpc2UuICAqLwogCi0gICAgICAgICAgICAgIHJldCA9 IHBvc2l4X2ZhbGxvY2F0ZSAoZmQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgKCBleGVfaGVhZGVyLT5zZWN0aW9uX2hlYWRlcltpXS5zX3NjbnB0ciArCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGVfaGVhZGVyLT5zZWN0aW9uX2hlYWRlcltp XS5zX3NpemUgKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAxKTsKKwkg ICAgICByZXQgPSBwb3NpeF9mYWxsb2NhdGUgKGZkLAorCQkJCSAgICAgKCBleGVfaGVhZGVyLT5z ZWN0aW9uX2hlY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wogICBy ZWdzLnguZHggPSBGb3JtYXQ7CkBAIC0zNDQsOCArMzQ0LDggQEAgZ2V0X2NsaXBib2FyZF9kYXRh ICh1bnNpZ25lZCBGb3JtYXQsIHZvaWQgKkRhdGEsIHVuc2lnbmVkIFNpemUsIGludCBSYXcpCiAJ CSAgICAgRFggPSBXaW5PbGRBcC1TdXBwb3J0ZWQgQ2xpcGJvYXJkIGZvcm1hdAogCQkgICAgIEVT OkJYID0gUG9pbnRlciB0byBkYXRhIGJ1ZmZlciB0byBob2xkIGRhdGEKICAgICAgUmV0dXJuIFZh bHVlcyAgIEFYID09IDA6IEVycm9yIG9jY3VycmVkIChvciBkYXRhIGluIHRoaXMgZm9ybWF0IGlz IG5vdAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW4gdGhlIGNsaXBib2FyZCkKLSAg ICAgICAgICAgICAgICAgICAgICAgIDw+IDA6IE9LICAqLworCQkJICAgICAgaW4gdGhlIGNsaXBi b2FyZCkKKwkJCTw+IDA6IE9LICAqLwogICByZWdzLnguYXggPSAweDE3MDU7CiAgIHJlZ3MueC5k eCA9IEZvcm1hdDsKICAgcmVncy54LmVzID0geGJ1Zl9hZGRyID4+IDQ7CkBAIC00MTAsNyArNDEw LDcgQEAgY2xvc2VfY2xpcGJvYXJkICh2b2lkKQogCiAgIC8qIENhbGxzIEludCAyRmgvQVg9MTcw OGgKICAgICAgUmV0dXJuIFZhbHVlcyAgIEFYID09IDA6IEVycm9yIG9jY3VycmVkCi0gICAgICAg ICAgICAgICAgICAgICAgICA8PiAwOiBPSyAqLworCQkJPD4gMDogT0sgKi8KICAgcmVncy54LmF4 ID0gMHgxNzA4OwogICBfX2RwbWlfaW50ICgweDJmLCAmcmVncyk7CiAgIHJldHVybiByZWdzLngu YXg7CkBAIC00MjMsOSArNDIzLDkgQEAgY2xpcGJvYXJkX2NvbXBhY3QgKHVuc2lnbmVkIFNpemUp CiAgIF9fZHBtaV9yZWdzIHJlZ3M7CiAKICAgLyogQ2F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QotICAgICAgICAoTG9va3VwQWNjb3VudFNpZF9Qcm9jKSBHZXRQcm9jQWRkcmVz cyAoaG1fYWR2YXBpMzIsIExvb2t1cEFjY291bnRTaWRfTmFtZSk7CisJKExvb2t1cEFjY291bnRT aWRfUHJvYykgR2V0UHJvY0FkZHJlc3MgKGhtX2FkdmFwaTMyLCBMb29rdXBBY2NvdW50U2lkX05h bWUpOwogICAgIH0KICAgaWYgKHNfcGZuX0xvb2t1cF9BY2NvdW50X1NpZCA9PSBOVUxMKQogICAg IHsKQEAgLTY0NCwxMyArNjQ0LDEzIEBAIGxvb2t1cF9hY2NvdW50X3NpZCAoTFBDVFNUUiBscFN5 c3RlbU5hbWUsCiAgICAgfQogICByZXR1cm4gKAogICAgICAgc19wZm5fTG9va3VwX0FjY291bnRf U2lkICgKLSAgICAgICAgICBscFN5c3RlbU5hbWUsCi0gICAgICAgICAgU2lkLAotICAgICAgICAg IE5hbWUsCi0gICAgICAgICAgY2JOYW1lLAotICAgICAgICAgIERvbWFpbk5hbWUsCi0gICAgICAg ICAgY2JEb21haW5OYW1lLAotICAgICAgICAgIHBlVXNlKQorCSAgbHBTeXN0ZW1OYW1lLAorCSAg U2lkLAorCSAgTmFtZSwKKwkgIGNiTmFtZSwKKwkgIERvbWFpbk5hbWUsCisJICBjYkRvbWFpbk5h bWUsCisJICBwZVVzZSkKICAgICAgICk7CiB9CiAKQEAgLTY2OSw4ICs2NjksOCBAQCBnZXRfc2lk X3N1Yl9hdXRob3JpdHkgKFBTSUQgcFNpZCwgRFdPUkQgbikKICAgICAgIGdfYl9pbml0X2dldF9z aWRfc3ViX2F1dGhvcml0eSA9IDE7CiAgICAgICBobV9hZHZhcGkzMiA9IExvYWRMaWJyYXJ5ICgi QWR2YXBpMzIuZGxsIik7CiAgICAgICBzX3Bmbl9HZXRfU2lkX1N1Yl9BdXRob3JpdHkgPQotICAg ICAgICAoR2V0U2lkU3ViQXV0aG9yaXR5X1Byb2MpIEdldFByb2NBZGRyZXNzICg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ICAgICAgICB7Ci0gICAgICAgICAgICAgIGVudl92YXJzW2ldLmRlZl92YWx1ZSA9IGxv Y2FsZV9uYW1lOwotICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgIH0KLSAgICAgICAg fQorCXsKKwkgIGlmIChzdHJjbXAgKGVudl92YXJzW2ldLm5hbWUsICJMQU5HIikgPT0gMCkKKwkg ICAgeworCSAgICAgIGVudl92YXJzW2ldLmRlZl92YWx1ZSA9IGxvY2FsZV9uYW1lOworCSAgICAg IGJyZWFrOworCSAgICB9CisJfQogICAgIH0KIAogI2RlZmluZSBTRVRfRU5WX0JVRl9TSVpFICg0 ICogTUFYX1BBVEgpCS8qIHRvIGNvdmVyIEVNQUNTTE9BRFBBVEggKi8KQEAgLTI4MzIsMTMgKzI4 MzIsMTMgQEAgaW5pdF9lbnZpcm9ubWVudCAoY2hhciAqKiBhcmd2KQogCQkgIH0KIAkJaWYgKHN0 cmNtcCAoZW52X3ZhcnNbaV0ubmFtZSwgIkhPTUUiKSA9PSAwICYmICFhcHBkYXRhKQogCQkgIFZk ZWxheWVkX3dhcm5pbmdzX2xpc3QKLSAgICAgICAgICAgICAgICAgICAgPSBGY29ucwotICAgICAg ICAgICAgICAgICAgICAobGlzdG4gKENPTlNUWVBFX0hFQVAsIDIsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50ZXJuICgiaW5pdGlhbGl6YXRpb24iKSwgYnVpbGRfc3RyaW5nCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgKCJVc2Ugb2YgYEM6XFwuZW1hY3MnIHdpdGhvdXQgZGVm aW5pbmcgYEhPTUUnXG4iCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICJpbiB0aGUgZW52 aXJvbm1lbnQgaXMgZGVwcmVjYXRlZCwgIgotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAi c2VlIGBXaW5kb3dzIEhPTUUnIGluIHRoZSBFbWFjcyBtYW51YWwuIikpLAotICAgICAgICAgICAg IC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ZXJybm8gKHByb2Nlc3MtPmdudXRsc19zdGF0ZSwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGVycm5vID09IEVXT1VMREJMT0NL ID8gRUFHQUlOIDogZXJybm8pOworCQkJCSAgICBlcnJubyA9PSBFV09VTERCTE9DSyA/IEVBR0FJ TiA6IGVycm5vKTsKIAogICByZXR1cm4gLTE7CiB9CmRpZmYgLS1naXQgYS9zcmMvdzMyLmggYi9z cmMvdzMyLmgKaW5kZXggYzczZmYzMC4uZThkZmVkNiAxMDA2NDQKLS0tIGEvc3JjL3czMi5oCisr KyBiL3NyYy93MzIuaApAQCAtMjMyLDExICsyMzIsMTEgQEAgZXh0ZXJuIGludCB3MzJfaW5pdF9y YW5kb20gKHZvaWQgKiwgcHRyZGlmZl90KTsKIAogLyogR251VExTIHB1bGwgKHJlYWQgZnJvbSBy ZW1vdGUpIGludGVyZmFjZS4gICovCiBleHRlcm4gc3NpemVfdCBlbWFjc19nbnV0bHNfcHVsbCAo Z251dGxzX3RyYW5zcG9ydF9wdHJfdCBwLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIHZvaWQqIGJ1Ziwgc2l6ZV90IHN6KTsKKwkJCQkgIHZvaWQqIGJ1Ziwgc2l6ZV90IHN6KTsK IAogLyogR251VExTIHB1c2ggKHdyaXRlIHRvIHJlbW90ZSkgaW50ZXJmYWNlLiAgKi8KIGV4dGVy biBzc2l6ZV90IGVtYWNzX2dudXRsc19wdXNoIChnbnV0bHNfdHJhbnNwb3J0X3B0cl90IHAsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgY29uc3Qgdm9pZCogYnVmLCBzaXplX3Qg c3opOworCQkJCSAgY29uc3Qgdm9pZCogYnVmLCBzaXplX3Qgc3opOwogI2VuZGlmIC8qIEhBVkVf R05VVExTICovCiAKIC8qIERlZmluaW5lIGEgZnVuY3Rpb24gdGhhdCB3aWxsIGJlIGxvYWRlZCBm cm9tIGEgRExMLiA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gICBjYXNlIFdNX1dUU1NFU1NJT05fQ0hB TkdFOgogICAgICAgaWYgKHdQYXJhbSA9PSBXVFNfU0VTU0lPTl9MT0NLKQotICAgICAgICByZXNl dF93MzJfa2JkaG9va19zdGF0ZSAoKTsKKwlyZXNldF93MzJfa2JkaG9va19zdGF0ZSAoKTsKICAg ICAgIGdvdG8gZGZsdDsKIAogICAgIGNhc2UgV01fQ0xPU0U6CkBAIC04MTAwLDkgKzgxMDAsOSBA QCB3MzJfcGFyc2VfYW5kX2hvb2tfaG90X2tleSAoTGlzcF9PYmplY3Qga2V5LCBpbnQgaG9vaykK ICAgICAgIHZrbmFtZSA9IFNTREFUQSAoU1lNQk9MX05BTUUgKGMpKTsKICAgICAgIC8qIFtzLV0s IFtNLV0sIFtoLV06IFJlZ2lzdGVyIGFsbCBrZXlzIGZvciB0aGlzIG1vZGlmaWVyICovCiAgICAg ICBpZiAodzMyX2tiZGhvb2tfYWN0aXZlICYmIHZrbmFtZVswXSA9PSAwKQotICAgICAgICB2a19j b2RlID0gVktfQU5ZOworCXZrX2NvZGUgPSBWS19BTlk7CiAgICAgICBlbHNlCi0gICAgICAgIHZr X2NvZGUgPSBsb29rdXBfdmtfY29kZSAodmtuYW1lKTsKKwl2a19jb2RlID0gbG9va3VwX3ZrX2Nv ZGUgKHZrbmFtZSk7CiAgICAgfQogICBlbHNlIGlmIChJTlRFR0VSUCAoYykpCiAgICAgewpAQCAt ODEzMCwyNyArODEzMCwyNyBAQCB3MzJfcGFyc2VfYW5kX2hvb2tfaG90X2tleSAoTGlzcF9PYmpl Y3Qga2V5LCBpbnQgaG9vaykKICAgICB7CiAgICAgICAvKiBSZWdpc3RlciBBbHQteCBjb21iaW5h dGlvbnMuICAqLwogICAgICAgaWYgKGxpc3BfbW9kaWZpZXJzICYgYWx0X21vZGlmaWVyKQotICAg ICAgICB7Ci0gICAgICAgICAgaG9va193MzJfa2V5IChob29rLCBWS19NRU5VLCB2a19jb2RlKTsK LSAgICAgICAgICByZXMgPSBRdDsKLSAgICAgICAgfQorCXsKKwkgIGhvb2tfdzMyX2tleSAoaG9v aywgVktfTUVOVSwgdmtfY29kZSk7CisJICByZXMgPSBRdDsKKwl9CiAgICAgICAvKiBSZWdpc3Rl ciBXaW4teCBjb21iaW5hdGlvbnMgYmFzZWQgb24gbW9kaWZpZXIgbWFwcGluZ3MuICAqLwogICAg ICAgaWYgKCgobGlzcF9tb2RpZmllcnMgJiBoeXBlcl9tb2RpZmllcikKIAkgICAmJiBFUSAoVncz Ml9sd2luZG93X21vZGlmaWVyLCBRaHlwZXIpKQogCSAgfHwgKChsaXNwX21vZGlmaWVycyAmIHN1 cGVyX21vZGlmaWVyKQogCSAgICAgICYmIEVRIChWdzMyX2x3aW5kb3dfbW9kaWZpZXIsIFFzdXBl cikpKQotICAgICAgICB7Ci0gICAgICAgICAgaG9va193MzJfa2V5IChob29rLCBWS19MV0lOLCB2 a19jb2RlKTsKLSAgICAgICAgICByZXMgPSBRdDsKLSAgICAgICAgfQorCXsKKwkgIGhvb2tfdzMy X2tleSAoaG9vaywgVktfTFdJTiwgdmtfY29kZSk7CisJICByZXMgPSBRdDsKKwl9CiAgICAgICBp ZiAoKChsaXNwX21vZGlmaWVycyAmIGh5cGVyX21vZGlmaWVyKQogCSAgICYmIEVRIChWdzMyX3J3 aW5kb3dfbW9kaWZpZXIsIFFoeXBlcikpCiAJICB8fCAoKGxpc3BfbW9kaWZpZXJzICYgc3VwZXJf bW9kaWZpZXIpCiAJICAgICAgJiYgRVEgKFZ3MzJfcndpbmRvd19tb2RpZmllciwgUXN1cGVyKSkp Ci0gICAgICAgIHsKLSAgICAgICAgICBob29rX3czMl9rZXkgKGhvb2ssIFZLX1JXSU4sIHZrX2Nv ZGUpOwotICAgICAgICAgIHJlcyA9IFF0OwotICAgICAgICB9CisJeworCSAgaG9va193MzJfa2V5 IChob29rLCBWS19SV0lOLCB2a19jb2RlKTsKKwkgIHJlcyA9IFF0OworCX0KICAgICAgIHJldHVy biByZXM7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RklYIHwg RFRfU0lOR0xFTElORSk7CisJCSBEVF9DQUxDUkVDVCB8IERUX05PUFJFRklYIHwgRFRfU0lOR0xF TElORSk7CiAgICAgICB0b3RhbF93aWR0aCA9IHJlY3QucmlnaHQ7CiAgICAgfQogCkBAIC02MjUs MTIgKzYyNSwxMiBAQCB3MzJmb250X2RyYXcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMsIGludCBm cm9tLCBpbnQgdG8sCiAJfQogCiAgICAgICBpZiAocy0+bnVtX2NsaXBzID4gMSkKLSAgICAgICAg ewotICAgICAgICAgIEhSR04gY2xpcDIgPSBDcmVhdGVSZWN0UmduSW5kaXJlY3QgKHMtPmNsaXAg KyAxKTsKKwl7CisJICBIUkdOIGNsaXAyID0gQ3JlYXRlUmVjdFJnbkluZGlyZWN0IChzLT5jbGlw ICsgMSk7CiAKLSAgICAgICAgICBDb21iaW5lUmduIChuZXdfY2xpcCwgbmV3X2NsaXAsIGNsaXAy LCBSR05fT1IpOwotICAgICAgICAgIERlbGV0ZU9iamVjdCAoY2xpcDIpOwotICAgICAgICB9CisJ ICBDb21iaW5lUmduIChuZXdfY2xpcCwgbmV3X2NsaXAsIGNsaXAyLCBSR05fT1IpOworCSAgRGVs ZXRlT2JqZWN0IChjbGlwMik7CisJfQogCiAgICAgICBTZWxlY3RDbGlwUmduIChzLT5oZGMsIG5l d19jbGlwKTsKICAgICAgIERlbGV0ZU9iamVjdCAobmV3X2NsaXApOwpAQCAtNzIyLDcgKzcyMiw3 IEBAIHczMmZvbnRfZG9uZV9mYWNlIChzdHJ1Y3QgZnJhbWUgKmYsIHN0cnVjdCBmYWNlICpmYWNl KTsgICovCiAgICBmb3IgYWN0dWFsIGRyYXdpbmcuCiBzdGF0aWMgaW50CiB3MzJmb250X2dldF9i aXRtYXAgKHN0cnVjdCBmb250ICpmb250LCB1bnNpZ25lZCBjb2RlLAotICAgICAgICAgICAgICAg ICAgICBzdHJ1Y3QgZm9udF9iaXRtYXAgKmJpdG1hcCwgaW50IGJpdHNfcGVyX3BpeGVsKTsKKwkJ ICAgIHN0cnVjdCBmb250X2JpdG1hcCAqYml0bWFwLCBpbnQgYml0c19wZXJfcGl4ZWwpOwogICAq LwogLyogdzMyIGltcGxlbWVudGF0aW9uIG9mIGZyZWVfYml0bWFwIGZvciBmb250IGJhY2tlbmQu CiAgICBPcHRpb25hbC4KQEAgLTczNyw3ICs3MzcsNyBAQCB3MzJmb250X2ZyZWVfYml0bWFwIChz dHJ1Y3QgZm9udCAqZm9udCwgc3RydWN0IGZvbnRfYml0bWFwICpiaXRtYXApOwogICAgdGhlIG9w ZXJhdGlvbnMgd2FzIHN1Y2Nlc3NmdWwuICBPdGhlcndpc2UgcmV0dXJuIC0xLgogc3RhdGljIGlu dAogdzMyZm9udF9hbmNob3JfcG9pbnQgKHN0cnVjdCBmb250ICpmb250LCB1bnNpZ25lZCBjb2Rl LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50IGluZGV4LCBpbnQgKngsIGlu dCAqeSk7CisJCQkJIGludCBpbmRleCwgaW50ICp4LCBpbnQgKnkpOwogICAqLwogLyogdzMyIGlt cGxlbWVudGF0aW9uIG9mIG90Zl9jYXBhYmlsaXR5IGZvciBmb250IGJhY2tlbmQuCiAgICBPcHRp b25hbC4KQEAgLTc2NCw5ICs3NjQsOSBAQCB3MzJmb250X290Zl9jYXBhYmlsaXR5IChzdHJ1Y3Qg Zm9udCAqZm9udCk7CiAgICBzaG9ydCwgcmV0dXJuIC0xLgogc3RhdGljIGludAogdzMyZm9udF9v dGZfZHJpdmUgKHN0cnVjdCBmb250ICpmb250LCBMaXNwX09iamVjdCBmZWF0dXJlcywKLSAgICAg ICAgICAgICAgICAgICBMaXNwX09iamVjdCBnc3RyaW5nX2luLCBpbnQgZnJvbSwgaW50IHRvLAot ICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IGdzdHJpbmdfb3V0LCBpbnQgaWR4LAotICAg ICAgICAgICAgICAgICAgIGJvb2wgYWx0ZXJuYXRlX3N1YnN0KTsKKwkJICAgTGlzcF9PYmplY3Qg Z3N0cmluZ19pbiwgaW50IGZyb20sIGludCB0bywKKwkJICAgTGlzcF9PYmplY3QgZ3N0cmluZ19v dXQsIGludCBpZHgsCisJCSAgIGJvb2wgYWx0ZXJuYXRlX3N1YnN0KTsKICAgKi8KIAogLyogSW50 ZXJuYWwgaW1wbGVtZW50YXRpb24gb2YgdzMyZm9udF9saXN0LgpAQCAtODA3LDcgKzgwNyw3IEBA IHczMmZvbnRfbGlzdF9pbnRlcm5hbCAoc3RydWN0IGZyYW1lICpmLCBMaXNwX09iamVjdCBmb250 X3NwZWMsCiAgIGlmIChtYXRjaF9kYXRhLnBhdHRlcm4ubGZGYWNlTmFtZVswXSA9PSAnXDAnKQog ICAgIHsKICAgICAgIC8qIEVudW1Gb250RmFtaWxpZXNFeCBkb2VzIG5vdCB0YWtlIG90aGVyIGZp ZWxkcyBpbnRvIGFjY291bnQgaWYKLSAgICAgICAgIGZvbnQgbmFtZSBpcyBibGFuaywgc28gbmVl ZCB0byB1c2UgdHdvIHBhc3Nlcy4gICovCisJIGZvbnQgbmFtZSBpcyBibGFuaywgc28gbmVlZCB0 byB1c2UgdHdvIHBhc3Nlcy4gICovCiAgICAgICBsaXN0X2FsbF9tYXRjaGluZ19mb250cyAoJm1h dGNoX2RhdGEpOwogICAgIH0KICAgZWxzZQpAQCAtODE1LDggKzgxNSw4IEBAIHczMmZvbnRfbGlz dF9pbnRlcm5hbCAoc3RydWN0IGZyYW1lICpmLCBMaXNwX09iamVjdCBmb250X3NwZWMsCiAgICAg ICBkYyA9IGdldF9mcmFtZV9kYyAoZik7CiAKICAgICAgIEVudW1Gb250RmFtaWxpZXNFeCAoZGMs ICZtYXRjaF9kYXRhLnBhdHRlcm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgIChGT05URU5V TVBST0MpIGFkZF9mb250X2VudGl0eV90b19saXN0LAotICAgICAgICAgICAgICAgICAgICAgICAg IC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taWx5ID0gdzMyX2dlbmVyaWNfZmFtaWx5ICh2YWwpOwogICAgICAgaWYgKGZh bWlseSAhPSBGRl9ET05UQ0FSRQotICAgICAgICAgICYmIGZhbWlseSAhPSAoZm9udC0+bnRtVG0u dG1QaXRjaEFuZEZhbWlseSAmIDB4RjApKQotICAgICAgICByZXR1cm4gMDsKKwkgICYmIGZhbWls eSAhPSAoZm9udC0+bnRtVG0udG1QaXRjaEFuZEZhbWlseSAmIDB4RjApKQorCXJldHVybiAwOwog ICAgIH0KIAogICAvKiBDaGVjayBzcGFjaW5nICovCkBAIC0xMjA4LDIyICsxMjA4LDIyIEBAIGZv bnRfbWF0Y2hlc19zcGVjIChEV09SRCB0eXBlLCBORVdURVhUTUVUUklDRVggKmZvbnQsCiAgICAg ICBMaXNwX09iamVjdCBleHRyYV9lbnRyeTsKICAgICAgIGV4dHJhX2VudHJ5ID0gWENBUiAoZXh0 cmEpOwogICAgICAgaWYgKENPTlNQIChleHRyYV9lbnRyeSkpCi0gICAgICAgIHsKLSAgICAgICAg ICBMaXNwX09iamVjdCBrZXkgPSBYQ0FSIChleHRyYV9lbnRyeSk7Ci0KLSAgICAgICAgICB2YWwg PSBYQ0RSIChleHRyYV9lbnRyeSk7Ci0gICAgICAgICAgaWYgKEVRIChrZXksIFFDc2NyaXB0KSAm JiBTWU1CT0xQICh2YWwpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICAvKiBPbmx5IHRy dWV0eXBlIGZvbnRzIHdpbGwgaGF2ZSBpbmZvcm1hdGlvbiBhYm91dCB3aGF0Ci0gICAgICAgICAg ICAgICAgIHNjcmlwdHMgdGhleSBzdXBwb3J0LiAgVGhpcyBwcm9iYWJseSBtZWFucyB0aGUgdXNl cgotICAgICAgICAgICAgICAgICB3aWxsIGhhdmUgdG8gZm9yY2UgRW1hY3MgdG8gdXNlIHJhc3Rl ciwgUG9zdFNjcmlwdAotICAgICAgICAgICAgICAgICBvciBBVE0gZm9udHMgZm9yIG5vbi1BU0N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BhbmVzZSBmb250cyBmb3IgSmFwYW5lc2UsIGV2ZW4KIAkJ ICAgICBpZiB0aGV5IGNsYWltIHRoZXkgYXJlIGNhcGFibGUsIGR1ZSB0byBrbm93bgpAQCAtMTIz Myw4OSArMTIzMyw4OSBAQCBmb250X21hdGNoZXNfc3BlYyAoRFdPUkQgdHlwZSwgTkVXVEVYVE1F VFJJQ0VYICpmb250LAogCQkgICAgICAmJiAoZm9udC0+bnRtVG0udG1DaGFyU2V0ICE9IFNISUZU SklTX0NIQVJTRVQKIAkJCSAgfHwgIShmb250LT5udG1Gb250U2lnLmZzQ3NiWzBdICYgQ1NCX0pB UEFORVNFKSkpCiAJCSAgICByZXR1cm4gMDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAg ICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAvKiBSZXR1cm4g c3BlY2lmaWMgbWF0Y2hlcywgYnV0IHBsYXkgaXQgc2FmZS4gRm9udHMKLSAgICAgICAgICAgICAg ICAgICAgIHRoYXQgY292ZXIgbW9yZSB0aGFuIHRoZWlyIGNoYXJzZXQgd291bGQgc3VnZ2VzdAot ICAgICAgICAgICAgICAgICAgICAgYXJlIGxpa2VseSB0byBiZSB0cnVldHlwZSBvciBvcGVudHlw ZSBmb250cywKLSAgICAgICAgICAgICAgICAgICAgIGNvdmVyZWQgYWJvdmUuICAqLwotICAgICAg ICAgICAgICAgICAgaWYgKEVRICh2YWwsIFFsYXRpbikpCi0gICAgICAgICAgICAgICAgICAgIHsK LSAgICAgICAgICAgICAgICAgICAgICAvKiBBbHRob3VnaCBldmVyeSBjaGFyc2V0IGJ1dCBzeW1i b2wsIHRoYWkgYW5kCi0gICAgICAgICAgICAgICAgICAgICAgICAgYXJhYmljIGNvbnRhaW5zIHRo ZSBiYXNpYyBBU0NJSSBzZXQgb2YgbGF0aW4KLSAgICAgICAgICAgICAgICAgICAgICAgICBjaGFy YWN0ZXJzLCBFbWFjcyBleHBlY3RzIG11Y2ggbW9yZS4gICovCi0gICAgICAgICAgICAgICAgICAg ICAgaWYgKGZvbnQtPm50bVRtLnRtQ2hhclNldCAhPSBBTlNJX0NIQVJTRVQpCi0gICAgICAgICAg ICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAg ICAgICAgICAgZWxzZSBpZiAoRVEgKHZhbCwgUXN5bWJvbCkpCi0gICAgICAgICAgICAgICAgICAg IHsKLSAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9udC0+bnRtVG0udG1DaGFyU2V0ICE9IFNZ TUJPTF9DSEFSU0VUKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAg ICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKEVRICh2YWwsIFFjeXJp bGxpYykpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICBpZiAo Zm9udC0+bnRtVG0udG1DaGFyU2V0ICE9IFJVU1NJQU5fQ0hBUlNFVCkKLSAgICAgICAgICAgICAg ICAgICAgICAgIHJldHVybiAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAg ICAgICBlbHNlIGlmIChFUSAodmFsLCBRZ3JlZWspKQotICAgICAgICAgICAgICAgICAgICB7Ci0g ICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbnQtPm50bVRtLnRtQ2hhclNldCAhPSBHUkVFS19D SEFSU0VUKQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICAg ICAgICAgIH0KLSAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKEVRICh2YWwsIFFhcmFiaWMpKQot ICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbnQtPm50 bVRtLnRtQ2hhclNldCAhPSBBUkFCSUNfQ0hBUlNFVCkKLSAgICAgICAgICAgICAgICAgICAgICAg IHJldHVybiAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgICAgICBlbHNl IGlmIChFUSAodmFsLCBRaGVicmV3KSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAg ICAgICAgICAgICAgIGlmIChmb250LT5udG1UbS50bUNoYXJTZXQgIT0gSEVCUkVXX0NIQVJTRVQp Ci0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsKLSAgICAgICAgICAgICAgICAgICAg fQotICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoRVEgKHZhbCwgUXRoYWkpKQotICAgICAgICAg ICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbnQtPm50bVRtLnRtQ2hh clNldCAhPSBUSEFJX0NIQVJTRVQpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsK LSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoRVEgKHZh bCwgUWthbmEpKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAg aWYgKGZvbnQtPm50bVRtLnRtQ2hhclNldCAhPSBTSElGVEpJU19DSEFSU0VUKQotICAgICAgICAg ICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAg ICAgICAgICAgIGVsc2UgaWYgKEVRICh2YWwsIFFib3BvbW9mbykpCi0gICAgICAgICAgICAgICAg ICAgIHsKLSAgICAgICAgICAgICAgICAgICAgICBpZiAoZm9udC0+bnRtVG0udG1DaGFyU2V0ICE9 IENISU5FU0VCSUc1X0NIQVJTRVQpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4gMDsK LSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgZWxzZSBpZiAoRVEgKHZh bCwgUWhhbmd1bCkpCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgICAg ICBpZiAoZm9udC0+bnRtVG0udG1DaGFyU2V0ICE9IEhBTkdVTF9DSEFSU0VUCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICYmIGZvbnQtPm50bVRtLnRtQ2hhclNldCAhPSBKT0hBQl9DSEFSU0VU KQotICAgICAgICAgICAgICAgICAgICAgICAgcmV0dXJuIDA7Ci0gICAgICAgICAgICAgICAgICAg IH0KLSAgICAgICAgICAgICAgICAgIGVsc2UgaWYgKEVRICh2YWwsIFFoYW4pKQotICAgICAgICAg ICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgaWYgKGZvbnQtPm50bVRtLnRtQ2hh clNldCAhPSBDSElORVNFQklHNV9DSEFSU0VUCi0gICAgICAgICAgICAgICAgICAgICAgICAgICYm IGZvbnQtPm50bVRtLnRtQ2hhclNldCAhPSBHQjIzMTJfQ0hBUlNFVAotICAgICAgICAgICAgICAg ICAgICAgICAgICAmJiBmb250LT5udG1UbS50bUNoYXJTZXQgIT0gSEFOR1VMX0NIQVJTRVQKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9udC0+bnRtVG0udG1DaGFyU2V0ICE9IEpPSEFC X0NIQVJTRVQKLSAgICAgICAgICAgICAgICAgICAgICAgICAgJiYgZm9udC0+bnRtVG0udG1DaGFy U2V0ICE9IFNISUZUSklTX0NIQVJTRVQpCi0gICAgICAgICAgICAgICAgICAgICAgICByZXR1cm4g MDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAg ICAgICAgICAgICAgICAvKiBPdGhlciBzY3JpcHRzIHVubGlrZWx5IHRvIGJlIGhhbmRsZWQgYnkg bm9uLXRydWV0eXBlCisJCX0KKwkgICAgICBlbHNlCisJCXsKKwkJICAvKiBSZXR1cm4gc3BlY2lm aWMgbWF0Y2hlcywgYnV0IHBsYXkgaXQgc2FmZS4gRm9udHMKKwkJICAgICB0aGF0IGNvd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IENPTlNQIChyZXN0KTsgcmVzdCA9IFhDRFIg KHJlc3QpKQogICAgICAgewotICAgICAgICBjaGFyICogeF9jaGFyc2V0OwotICAgICAgICBMaXNw X09iamVjdCB3MzJfY2hhcnNldDsKLSAgICAgICAgTGlzcF9PYmplY3QgY29kZXBhZ2U7Ci0KLSAg ICAgICAgTGlzcF9PYmplY3QgdGhpc19lbnRyeSA9IFhDQVIgKHJlc3QpOwotCi0gICAgICAgIC8q IFNraXAgaW52YWxpZCBlbnRyaWVzIGluIGFsaXN0LiAqLwotICAgICAgICBpZiAoIUNPTlNQICh0 aGlzX2VudHJ5KSB8fCAhU1RSSU5HUCAoWENBUiAodGhpc19lbnRyeSkpCi0gICAgICAgICAgICB8 fCAhQ09OU1AgKFhDRFIgKHRoaXNfZW50cnkpKQotICAgICAgICAgICAgfHwgIVNZTUJPTFAgKFhD QVIgKFhDRFIgKHRoaXNfZW50cnkpKSkpCi0gICAgICAgICAgY29udGludWU7Ci0KLSAgICAgICAg eF9jaGFyc2V0ID0gU1NEQVRBIChYQ0FSICh0aGlzX2VudHJ5KSk7Ci0gICAgICAgIHczMl9jaGFy c2V0ID0gWENBUiAoWENEUiAodGhpc19lbnRyeSkpOwotICAgICAgICBjb2RlcGFnZSA9IFhDRFIg KFhDRFIgKHRoaXNfZW50cnkpKTsKLQotICAgICAgICAvKiBMb29rIGZvciBTYW1lIGNoYXJzZXQg YW5kIGEgdmFsaWQgY29kZXBhZ2UgKG9yIG5vbi1pbnQKLSAgICAgICAgICAgd2hpY2ggbWVhbnMg aWdub3JlKS4gICovCi0gICAgICAgIGlmIChFUSAodzMyX2NoYXJzZXQsIGNoYXJzZXRfdHlwZSkK LSAgICAgICAgICAgICYmICghSU5URUdFUlAgKGNvZGVwYWdlKSB8fCBYSU5UIChjb2RlcGFnZSkg PT0gQ1BfREVGQVVMVAotICAgICAgICAgICAgICAgIHx8IElzVmFsaWRDb2RlUGFnZSAoWElOVCAo Y29kZXBhZ2UpKSkpCi0gICA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Jlc3RfbWF0Y2ggPSB4X2NoYXJzZXQ7Ci0gICAgICAgICAgICAgIH0K LSAgICAgICAgICB9CisJICAgIC8qIElmIGJvdGggYXJlIElTTzg4NTkgY29kZXBhZ2VzLCBjaG9v c2UgdGhlIG9uZSB3aXRoIHRoZQorCSAgICAgICBsb3dlc3QgbnVtYmVyIGluIHRoZSBlbmNvZGlu ZyBmaWVsZC4gICovCisJICAgIGVsc2UgaWYgKHN0cm5pY21wIChiZXN0X21hdGNoLCAiaXNvODg1 OS0iLCA4KSA9PSAwCisJCSAgICAgJiYgc3RybmljbXAgKHhfY2hhcnNldCwgImlzbzg4NTktIiwg OCkgPT0gMCkKKwkgICAgICB7CisJCWludCBiZXN0X2VuYyA9IGF0b2kgKGJlc3RfbWF0Y2ggKyA4 KTsKKwkJaW50IHRoaXNfZW5jID0gYXRvaSAoeF9jaGFyc2V0ICsgOCk7CisJCWlmICh0aGlzX2Vu YyA+IDAgJiYgdGhpc19lbmMgPCBiZXN0X2VuYykKKwkJICBiZXN0X21hdGNoID0geF9jaGFyc2V0 OworCSAgICAgIH0KKwkgIH0KICAgICAgIH0KIAogICAgIC8qIElmIG5vIG1hdGNoLCBlbmNvZGUg dGhlIG51bWVyaWMgdmFsdWUuICovCiAgICAgaWYgKCFiZXN0X21hdGNoKQogICAgICAgewotICAg ICAgICBzcHJpbnRmIChidWYsICIqLSMlZCIsIGZuY2hhcnNldCk7Ci0gICAgICAgIHJldHVybiBi dWY7CisJc3ByaW50ZiAoYnVmLCAiKi0jJWQiLCBmbmNoYXJzZXQpOworCXJldHVybiBidWY7CiAg ICAgICB9CiAKICAgICBzdHJuY3B5IChidWYsIGJlc3RfbWF0Y2gsIDMxKTsKQEAgLTE5NzYsOSAr MTk3Niw5IEBAIGZpbGxfaW5fbG9nZm9udCAoc3RydWN0IGZyYW1lICpmLCBMT0dGT05UICpsb2dm b250LCBMaXNwX09iamVjdCBmb250X3NwZWMpCiAgICAgewogICAgICAgbG9nZm9udC0+bGZQa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mIGNoYXJzZXQgaXMg bm90IHByb3ZpZGVkLCBvciBpcyBVbmljb2RlCisJICAgICBhbmQgYSBzaW5nbGUgc2NyaXB0IGlz IHNwZWNpZmllZC4gIFRoaXMgaXMgcmF0aGVyIGNydWRlLAorCSAgICAgYW5kIGlzIG9ubHkgdXNl ZCB0byBuYXJyb3cgZG93biB0aGUgZm9udHMgcmV0dXJuZWQgd2hlcmUKKwkgICAgIHRoZXJlIGlz IGEgZGVmaW5pdGUgbWF0Y2guICBTb21lIHNjcmlwdHMsIHN1Y2ggYXMgbGF0aW4sIGhhbiwKKwkg ICAgIGNqay1taXNjIG1hdGNoIG11bHRpcGxlIGxmQ2hhclNldCB2YWx1ZXMsIHNvIHdlIGNhbid0 IHByZS1maWx0ZXIKKwkgICAgIHRoZW0uICAqLwogCSAgaWYgKEVRIChrZXksIFFDc2NyaXB0KQot ICAgICAgICAgICAgICAgICAgICYmIGxvZ2ZvbnQtPmxmQ2hhclNldCA9PSBERUZBVUxUX0NIQVJT RVQKLSAgICAgICAgICAgICAgICAgICAmJiBTWU1CT0xQICh2YWwpKQotICAgICAgICAgICAgewot ICAgICAgICAgICAgICBpZiAoRVEgKHZhbCwgUWdyZWVrKSkKLSAgICAgICAgICAgICAgICBsb2dm b250LT5sZkNoYXJTZXQgPSBHUkVFS19DSEFSU0VUOwotICAgICAgICAgICAgICBlbHNlIGlmIChF USAodmFsLCBRaGFuZ3VsKSkKLSAgICAgICAgICAgICAgICBsb2dmb250LT5sZkNoYXJTZXQgPSBI QU5HVUxfQ0hBUlNFVDsKLSAgICAgICAgICAgICAgZWxzZSBpZiAoRVEgKHZhbCwgUWthbmEpIHx8 IEVRICh2YWwsIFFrYW5idW4pKQotICAgICAgICAgICAgICAgIGxvZ2ZvbnQtPmxmQ2hhclNldCA9 IFNISUZUSklTX0NIQVJTRVQ7Ci0gICAgICAgICAgICAgIGVsc2UgaWYgKEVRICh2YWwsIFFib3Bv bW9mbykpCi0gICAgICAgICAgICAgICAgbG9nZm9udC0+bGZDaGFyU2V0ID0gQ0hJTkVTRUJJRzVf Q0hBUlNFVDsKLSAgICAgICAgICAgICAgLyogR0IgMTgwMzAgc3VwcG9ydHMgdGliZXRhbiwgeWks IG1vbmdvbGlhbiwKLSAgICAgICAgICAgICAgICAgZm9udHMgdGhhdCBzdXBwb3J0IGl0IHNob3Vs ZCBzaG93IHVwIGlmIHdlIGFzayBmb3IKLSAgICAgICAgICAgICAgICAgR0IyMzEyIGZvbnRzLiAq LwotICAgICAgICAgICAgICBlbHNlIGlmIChFUSAodmFsLCBRdGliZXRhbikgfHwgRVEgKHZhbCwg UXlpKQotICAgICAgICAgICAgICAgICAgICAgICB8fCBFUSAodmFsLCBRbW9uZ29saWFuKSkKLSAg ICAgICAgICAgICAgICBsb2dmb250LT5sZkNoYXJTZXQgPSBHQjIzMTJfQ0hBUlNFVDsKLSAgICAg ICAgICAgICAgZWxzZSBpZiAoRVEgKHZhbCwgUWhlYnJldykpCi0gICAgICAgICAgICAgICAgbG9n Zm9udC0+bGZDaGFyU2V0ID0gSEVCUkVXX0NIQVJTRVQ7Ci0gICAgICAgICAgICAgIGVsc2UgaWYg KEVRICh2YWwsIFFhcmFiaWMpKQotICAgICAgICAgICAgICAgIGxvZ2ZvbnQtPmxmQ2hhclNldCA9 IEFSQUJJQ19DSEFSU0VUOwotICAgICAgICAgICAgICBlbHNlIGlmIChFUSAodmFsLCBRdGhhaSkp Ci0gICAgICAgICAgICAgICAgbG9nZm9udC0+bGZDaGFyU2V0ID0gVEhBSV9DSEFSU0VUOwotICAg ICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKEVRIChrZXksIFFDYW50aWFsaWFzKSAmJiBT WU1CT0xQICh2YWwpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBsb2dmb250LT5sZlF1 YWxpdHkgPSB3MzJfYW50aWFsaWFzX3R5cGUgKHZhbCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAg IH0KKwkJICAgJiYgbG9nZm9ud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cnVjdCB3MzJmb250X2luZm8KIAogTGlzcF9PYmplY3QgdzMyZm9udF9nZXRfY2FjaGUgKHN0cnVj dCBmcmFtZSAqZmUpOwogTGlzcF9PYmplY3QgdzMyZm9udF9saXN0X2ludGVybmFsIChzdHJ1Y3Qg ZnJhbWUgKmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IGZvbnRfc3BlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCBvcGVu dHlwZV9vbmx5KTsKKwkJCQkgICBMaXNwX09iamVjdCBmb250X3NwZWMsCisJCQkJICAgYm9vbCBv cGVudHlwZV9vbmx5KTsKIExpc3BfT2JqZWN0IHczMmZvbnRfbWF0Y2hfaW50ZXJuYWwgKHN0cnVj dCBmcmFtZSAqZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2Jq ZWN0IGZvbnRfc3BlYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGJvb2wg b3BlbnR5cGVfb25seSk7CisJCQkJICAgIExpc3BfT2JqZWN0IGZvbnRfc3BlYywKKwkJCQkgICAg Ym9vbCBvcGVudHlwZV9vbmx5KTsKIGludCB3MzJmb250X29wZW5faW50ZXJuYWwgKHN0cnVjdCBm cmFtZSAqZiwgTGlzcF9PYmplY3QgZm9udF9lbnRpdHksCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQgcGl4ZWxfc2l6ZSwgTGlzcF9PYmplY3QgZm9udF9vYmplY3QpOworCQkJICAgaW50 IHBpeGVsX3NpemUsIExpc3BfT2JqZWN0IGZvbnRfb2JqZWN0KTsKIHZvaWQgdzMyZm9udF9jbG9z ZSAoc3RydWN0IGZvbnQgKmZvbnQpOwogaW50IHczMmZvbnRfaGFzX2NoYXIgKExpc3BfT2JqZWN0 IGVudGl0eSwgaW50IGMpOwogdm9pZCB3MzJmb250X3RleHRfZXh0ZW50cyAoc3RydWN0IGZvbnQg KmZvbnQsIHVuc2lnbmVkICpjb2RlLCBpbnQgbmdseXBocywKIAkJCSAgIHN0cnVjdCBmb250X21l dHJpY3MgKm1ldHJpY3MpOwogaW50IHczMmZvbnRfZHJhdyAoc3RydWN0IGdseXBoX3N0cmluZyAq cywgaW50IGZyb20sIGludCB0bywKLSAgICAgICAgICAgICAgICAgIGludCB4LCBpbnQgeSwgYm9v bCB3aXRoX2JhY2tncm91bmQpOworCQkgIGludCB4LCBpbnQgeSwgYm9vbCB3aXRoX2JhY2tncm91 bmQpOwogCiAKIGludCB1bmlzY3JpYmVfY2hlY2tfb3RmIChMT0dGT05UICpmb250LCBMaXNwX09i amVjdCBvdGZfc3BlYyk7CmRpZmYgLS1naXQgYS9zcmMvdzMyaGVhcC5jIGIvc3JjL3czMmhlYXAu YwppbmRleCAyNmEwNDQxLi42NDEwOTY3IDEwMDY0NAotLS0gYS9zcmMvdzMyaGVhcC5jCisrKyBi L3NyYy93MzJoZWFwLmMKQEAgLTY1LDEzICs2NSwxMyBAQAogICAgRERLLiAgKi8KIAogdHlwZWRl ZiBQVk9JRCAoV0lOQVBJICogUnRsQ3JlYXRlSGVhcF9Qcm9jKSAoCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBfSW5fICovICAgICAgVUxPTkcgRmxhZ3Ms Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBfSW5fb3B0 XyAqLyAgUFZPSUQgSGVhcEJhc2UsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAvKiBfSW5fb3B0XyAqLyAgU0laRV9UIFJlc2VydmVTaXplLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogX0luX29wdF8gKi8gIFNJWkVf VCBDb21taXRTaXplLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgLyogX0luX29wdF8gKi8gIFBWT0lEIExvY2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAvKiBfSW5fb3B0XyAqLyAgUFZPSUQgUGFyYW1ldGVycwotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgKTsKKwkJCQkJICAgICAv KiBfSW5fICovICAgICAgVUxPTkcgRmxhZ3MsCisJCQkJCSAgICAgLyogX0luX29wdF8gKi8gIFBW T0lEIEhlYXBCYXNlLAorCQkJCQkgICAgIC8qIF9Jbl9vcHRfICovICBTSVpFX1QgUmVzZXJ2ZVNp emUsCisJCQkJCSAgICAgLyogX0luX29wdF8gKi8gIFNJWkVfVCBDb21taXRTaXplLAorCQkJCQkg ICAgIC8qIF9Jbl9vcHRfICovICBQVk9JRCBMb2NrLAorCQkJCQkgICAgIC8qIF9Jbl9vcHRfICov ICBQVk9JRCBQYXJhbWV0ZXJzCisJCQkJCSAgICAgKTsKIAogdHlwZWRlZiBMT05HIE5UU1RBVFVT OwogCkBAIC0xNTEsNyArMTUxLDcgQEAgc3RhdGljIERXT1JEX1BUUiBjb21taXR0ZWQgPSAwOwog ICAtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCiAgIF4gICAg ICAgICAgICAgICBeICAgICAgICAgICAgICBeCiAgIGR1bXBlZF9kYXRhICAgICBkdW1wZWRfZGF0 YSAgICBiY19saW1pdAotICAgICAgICAgICAgICAgICAgKyBjb21taXR0ZWQKKwkJICArIGNvbW1p dHRlZAogCiAqLwogCkBAIC0yMzEsMTUgKzIzMSwxNSBAQCBpbml0X2hlYXAgKHZvaWQpCiAgICAg ICB1bnNpZ25lZCBsb25nIGVuYWJsZV9sZmggPSAyOwogCiAgICAgICAvKiBBZnRlciBkdW1waW5n LCB1c2UgYSBuZXcgcHJpdmF0ZSBoZWFwLiAgV2UgZXhwbGljaXRseSBlbmFibGUKLSAgICAgICAg I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gICAvKiBXaXRoIFVURi04LCAmIGNhbm5vdCBiZSBwYXJ0IG9mIGEgbXVsdGli eXRlIGNoYXJhY3Rlci4gICovCi0gICAgICAgICAgZm9yIChwID0gb3V0X3N0cmluZzsgKnA7IHAr KykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaWYgKCpwID09ICcmJykKLSAgICAgICAg ICAgICAgICBubGVuKys7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJICAvKiBXaXRo IFVURi04LCAmIGNhbm5vdCBiZSBwYXJ0IG9mIGEgbXVsdGlieXRlIGNoYXJhY3Rlci4gICovCisJ ICBmb3IgKHAgPSBvdXRfc3RyaW5nOyAqcDsgcCsrKQorCSAgICB7CisJICAgICAgaWYgKCpwID09 ICcmJykKKwkJbmxlbisrOworCSAgICB9CisJfQogI2lmbmRlZiBOVEdVSV9VTklDT0RFCiAgICAg ICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICAvKiBJZiBlbmNvZGVkIHdpdGggdGhlIHN5c3Rl bSBjb2RlcGFnZSwgdXNlIG11bHRpYnl0ZSBzdHJpbmcKLSAgICAgICAgICAgICBmdW5jdGlvbnMg aW4gY2FzZSBvZiBtdWx0aWJ5dGUgY2hhcmFjdGVycyB0aGF0IGNvbnRhaW4gJyYnLiAgKi8KLSAg ICAgICAgICBmb3IgKHAgPSBvdXRfc3RyaW5nOyAqcDsgcCA9IF9tYnNpbmMgKHApKQotICAgICAg ICAgICAgewotICAgICAgICAgICAgICBpZiAoX21ic25leHRjIChwKSA9PSAnJicpCi0gICAgICAg ICAgICAgICAgbmxlbisrOwotICAgICAgICAgICAgfQotICAgICAgICB9CisJeworCSAgLyogSWYg ZW5jb2RlZCB3aXRoIHRoZSBzeXN0ZW0gY29kZXBhZ2UsIHVzZSBtdWx0aWJ5dGUgc3RyaW5nCisJ ICAgICBmdW5jdGlvbnMgaW4gY2FzZSBvZiBtdWx0aWJ5dGUgY2hhcmFjdGVycyB0aGF0IGNvbnRh aW4gJyYnLiAgKi8KKwkgIGZvciAocCA9IG91dF9zdHJpbmc7ICpwOyBwID0gX21ic2luYyAocCkp CisJICAgIHsKKwkgICAgICBpZiAoX21ic25leHRjIChwKSA9PSAnJicpCisJCW5sZW4rKzsKKwkg ICAgfQorCX0KICNlbmRpZiAvKiAhTlRHVUlfVU5JQ09ERSAqLwogCiAgICAgICBpZiAobmxlbiA+ IG9yaWdfbGVuKQotICAgICAgICB7Ci0gICAgICAgICAgcCA9IG91dF9zdHJpbmc7Ci0gICAgICAg ICAgb3V0X3N0cmluZyA9IFNBRkVfQUxMT0NBIChubGVuICsgMSk7Ci0gICAgICAgICAgcSA9IG91 dF9zdHJpbmc7Ci0gICAgICAgICAgd2hpbGUgKCpwKQotICAgICAgICAgICAgewotICAgICAgICAg ICAgICBpZiAodW5pY29kZV9hcHBlbmRfbWVudSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICBpZiAoKnAgPT0gJyYnKQotICAgICAgICAgICAgICAgICAgICAqcSsrID0gKnA7 Ci0gICAgICAgICAgICAgICAgICAqcSsrID0gKnArKzsKLSAgICAgICAgICAgICAgICB9CisJewor CSAgcCA9IG91dF9zdHJpbmc7CisJICBvdXRfc3RyaW5nID0gU0FGRV9BTExPQ0EgKG5sZW4gKyAx KTsKKwkgIHEgPSBvdXRfc3RyaW5nOworCSAgd2hpbGUgKCpwKQorCSAgICB7CisJICAgICAgaWYg KHVuaWNvZGVfYXBwZW5kX21lbnUpCisJCXsKKwkJICBpZiAoKnAgPT0gJyYnKQorCQkgICAgKnEr KyA9ICpwOworCQkgICpxKysgPSAqcCsrOworCQl9CiAjaWZuZGVmIE5UR1VJX1VOSUNPREUKLSAg ICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGlm IChfbWJzbmV4dGMgKHApID09ICcmJykKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAg ICAgICAgICAgICAgIF9tYnNuY3B5IChxLCBwLCAxKTsKLSAgICAgICAgICAgICAgICAgICAgICBx ID0gX21ic2luYyAocSk7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAg IF9tYnNuY3B5IChxLCBwLCAxKTsKLSAgICAgICAgICAgICAgICAgIHAgPSBfbWJzaW5jIChwKTsK LSAgICAgICAgICAgICAgICAgIHEgPSBfbWJzaW5jIChxKTsKLSAgICAgICAgICAgICAgICB9CisJ ICAgICAgZWxzZQorCQl7CisJCSAgaWYgKF9tYnNuZXh0YyAocCkgPT0gJyYnKQorCQkgICAgewor CQkgICAgICBfbWJzbmNweSAocSwgcCwgMSk7CisJCSAgICAgIHEgPSBfbWJzaW5jIChxKTsKKwkJ ICAgIH0KKwkJICBfbWJzbmNweSAocSwgcCwgMSk7CisJCSAgcCA9IF9tYnNpbmMgKHApOworCQkg IHEgPSBfbWJzaW5jIChxKTsKKwkJfQogI2VuZGlmIC8qICFOVEdVSV9VTklDT0RFICovCi0gICAg ICAgICAgICB9Ci0gICAgICAgICAgKnEgPSAnXDAnOwotICAgICAgICB9CisJICAgIH0KKwkgICpx ID0gJ1wwJzsKKwl9CiAKICAgICAgIGlmIChpdGVtICE9IE5VTEwpCiAJZnVGbGFncyA9IE1GX1BP UFVQOwpAQCAtMTMxNSw4ICsxMzE1LDggQEAgYWRkX21lbnVfaXRlbSAoSE1FTlUgbWVudSwgd2lk Z2V0X3ZhbHVlICp3diwgSE1FTlUgaXRlbSkKIAkgICAgIHdlIGNhbid0IGRlYWxsb2NhdGUgdGhl IG1lbW9yeSBvdGhlcndpc2UuICAqLwogCSAgaWYgKGdldF9tZW51X2l0ZW1faW5mbykKIAkgICAg ewotICAgICAgICAgICAgICBvdXRfc3RyaW5nID0gKGNoYXIgKikgbG9jYWxfYWxsb2MgKHN0cmxl biAod3YtPm5hbWUpICsgMSk7Ci0gICAgICAgICAgICAgIHN0cmNweSAob3V0X3N0cmluZywgd3Yt Pm5hbWUpOworCSAg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CisJICAgICB2ZXJzaW9ucyBkb24ndCwgb25seSBjaGVjayA2NCBiaXQgZXhlcyBp ZiB3ZSBrbm93IGhvdy4gICovCiAjaWZkZWYgSU1BR0VfTlRfT1BUSU9OQUxfSERSNjRfTUFHSUMK LSAgICAgICAgICBlbHNlIGlmIChudF9oZWFkZXItPk9wdGlvbmFsSGVhZGVyLk1hZ2ljCi0gICAg ICAgICAgICAgICAgICAgPT0gSU1BR0VfTlRfT1BUSU9OQUxfSERSNjRfTUFHSUMpCi0gICAgICAg ICAgICB7Ci0gICAgICAgICAgICAgIElNQUdFX09QVElPTkFMX0hFQURFUjY0ICpvcHQKLSAgICAg ICAgICAgICAgICA9IChJTUFHRV9PUFRJT05BTF9IRUFERVI2NCopICYobnRfaGVhZGVyLT5PcHRp b25hbEhlYWRlcik7Ci0gICAgICAgICAgICAgIGRhdGFfZGlyID0gb3B0LT5EYXRhRGlyZWN0b3J5 OwotICAgICAgICAgICAgICAqaXNfZ3VpX2FwcCA9IChvcHQtPlN1YnN5c3RlbSA9PSBJTUFHRV9T VUJTWVNURU1fV0lORE9XU19HVUkpOwotICAgICAgICAgICAgfQorCSAgZWxzZSBpZiAobnRfaGVh ZGVyLT5PcHRpb25hbEhlYWRlci5NYWdpYworCQkgICA9PSBJTUFHRV9OVF9PUFRJT05BTF9IRFI2 NF9NQUdJQykKKwkgICAgeworCSAgICAgIElNQUdFX09QVElPTkFMX0hFQURFUjY0ICpvcHQKKwkJ PSAoSU1BR0VfT1BUSU9OQUxfSEVBREVSNjQqKSAmKG50X2hlYWRlci0+T3B0aW9uYWxIZWFkZXIp OworCSAgICAgIGRhdGFfZGlyID0gb3B0LT5EYXRhRGlyZWN0b3J5OworCSAgICAgICppc19ndWlf YXBwID0gKG9wdC0+U3Vic3lzdGVtID09IElNQUdFX1NVQlNZU1RFTV9XSU5ET1dTX0dVSSk7CisJ ICAgIH0KICNlbmRpZgotICAgICAgICAgIGlmIChkYXRhX2RpcikKLSAgICAgICAgICAgIHs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bXBvcnRzLT5OYW1lLCBzZWN0aW9uLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBleGVjdXRhYmxlKTsKLQotICAg ICAgICAgICAgICAgICAgLyogVGhlIGV4YWN0IG5hbWUgb2YgdGhlIEN5Z3dpbiBETEwgaGFzIGNo YW5nZWQgd2l0aAotICAgICAgICAgICAgICAgICAgICAgdmFyaW91cyByZWxlYXNlcywgYnV0IGhv cGVmdWxseSB0aGlzIHdpbGwgYmUKLSAgICAgICAgICAgICAgICAgICAgIHJlYXNvbmFibHkgZnV0 dXJlLXByb29mLiAgKi8KLSAgICAgICAgICAgICAgICAgIGlmIChzdHJuY21wIChkbGxuYW1lLCAi Y3lnd2luIiwgNikgPT0gMCkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgICAgICppc19jeWdudXNfYXBwID0gVFJVRTsKLSAgICAgICAgICAgICAgICAgICAgICBicmVh azsKLSAgICAgICAgICAgICAgICAgICAgfQorCQkgIGNoYXIgKiBkbGxuYW1lID0gUlZBX1RPX1BU UiAoaW1wb3J0cy0+TmFtZSwgc2VjdGlvbiwKKwkJCQkJICAgICAgIGV4ZWN1dGFibGUpOworCisJ CSAgLyogVGhlIGV4YWN0IG5hbWUgb2YgdGhlIEN5Z3dpbiBETEwgaGFzIGNoYW5nZWQgd2l0aAor CQkgICAgIHZhcmlvdXMgcmVsZWFzZXMsIGJ1dCBob3BlZnVsbHkgdGhpcyB3aWxsIGJlCisJCSAg ICAgcmVhc29uYWJseSBmdXR1cmUtcHJvb2YuICAqLworCQkgIGlmIChzdHJuY21wIChkbGxuYW1l LCAiY3lnd2luIiwgNikgPT0gMCkKKwkJICAgIHsKKwkJICAgICAgKmlzX2N5Z251c19hcHAgPSBU UlVFOworCQkgICAgICBicmVhazsKKwkJICAgIH0KIAkJICBlbHNlIGlmIChzdHJuY21wIChkbGxu YW1lLCAibXN5cy0iLCA1KSA9PSAwKQogCQkgICAgewog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hyZWFkLCBUUlVFKSkKLSAgICAgICAgICAgICAgICBmb3JlZ3JvdW5k X3RocmVhZCA9IDA7CisJCSAgfHwgIUF0dGFjaFRocmVhZElucHV0IChHZXRDdXJyZW50VGhyZWFk SWQgKCksCisJCQkJCSBmb3JlZ3JvdW5kX3RocmVhZCwgVFJVRSkpCisJCWZvcmVncm91bmRfdGhy ZWFkID0gMDsKIAotICAgICAgICAgICAgICBjaGlsZF90aHJlYWQgPSBHZXRXaW5kb3dUaHJlYWRQ cm9jZXNzSWQgKGNwLT5od25kLCBOVUxMKTsKKwkgICAgICBjaGlsZF90aHJlYWQgPSBHZXRXaW5k b3dUaHJlYWRQcm9jZXNzSWQgKGNwLT5od25kLCBOVUxMKTsKIAkgICAgICBpZiAoY2hpbGRfdGhy ZWFkID09IEdldEN1cnJlbnRUaHJlYWRJZCAoKQotICAgICAgICAgICAgICAgICAgfHwgIUF0dGFj aFRocmVhZElucHV0IChHZXRDdXJyZW50VGhyZWFkSWQgKCksCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGNoaWxkX3RocmVhZCwgVFJVRSkpCi0gICAgICAgICAgICAg ICAgY2hpbGRfdGhyZWFkID0gMDsKLQotICAgICAgICAgICAgICAvKiBTZXQgdGhlIGZvcmVncm91 bmQgd2luZG93IHRvIHRoZSBjaGlsZC4gICovCi0gICAgICAgICAgICAgIGlmIChTZXRGb3JlZ3Jv dW5kV2luZG93IChjcC0+aHduZCkpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgLyogR2VuZXJhdGUga2V5c3Ryb2tlcyBhcyBpZiB1c2VyIGhhZCB0eXBlZCBDdHJsLUJyZWFr IG9yCi0gICAgICAgICAgICAgICAgICAgICBDdHJsLUMuICAqLwotICAgICAgICAgICAgICAgICAg a2V5YmRfZXZlbnQgKFZLX0NPTlRST0wsIGNvbnRyb2xfc2Nhbl9jb2RlLCAwLCAwKTsKLSAgICAg ICAgICAgICAgICAgIGtleWJkX2V2ZW50ICh2a19icmVha19jb2RlLCBicmVha19zY2FuX2NvZGUs CisJCSAgfHwgIUF0dGFjaFRocmVhZElucHV0IChHZXRDdXJyZW50VGhyZWFkSWQgKCksCisJCQkJ CSBjaGlsZF90aHJlYWQsIFRSVUUpKQorCQljaGlsZF90aHJlYWQgPSAwOworCisJICAgICAgLyog U2V0IHRoZSBmb3JlZ3JvdW5kIHdpbmRvdyB0byB0aGUgY2hpbGQuICAqLworCSAgICAgIGlmIChT ZXRGb3JlZ3JvdW5kV2luZG93IChjcC0+aHduZCkpCisJCXsKKwkJICAvKiBHZW5lcmF0ZSBrZXlz dHJva2VzIGFzIGlmIHVzZXIgaGFkIHR5cGVkIEN0cmwtQnJlYWsgb3IKKwkJICAgICBDdHJsLUMu ICAqLworCQkgIGtleWJkX2V2ZW50IChWS19DT05UUk9MLCBjb250cm9sX3NjYW5fY29kZSwgMCwg MCk7CisJCSAga2V5YmRfZXZlbnQgKHZrX2JyZWFrX2NvZGUsIGJyZWFrX3NjYW5fY29kZSwKIAkJ ICAgICh2a19icmVha19jb2RlID09ICdDJyA/IDAgOiBLRVlFVkVOVEZfRVhURU5ERURLRVkpLCAw KTsKLSAgICAgICAgICAgICAgICAgIGtleWJkX2V2ZW50ICh2a19icmVha19jb2RlLCBicmVha19z Y2FuX2NvZGUsCi0gICAgICAgICAgICAgICAgICAgICh2a19icmVha19jb2RlID09ICdDJyA/IDAg OiBLRVlFVkVOVEZfRVhURU5ERURLRVkpCi0gICAgICAgICAgICAgICAgICAgIHwgS0VZRVZFTlRG X0tFWVVQLCAwKTsKLSAgICAgICAgICAgICAgICAgIGtleWJkX2V2ZW50IChWS19DT05UUk9MLCBj b250cm9sX3NjYW5fY29kZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBLRVlFVkVO VEZfS0VZVVAsIDApOwotCi0gICAgICAgICAgICAgICAgICAvKiBTbGVlcCBmb3IgYSBiaXQgdG8g Z2l2ZSB0aW1lIGZvciBFbWFjcyBmcmFtZSB0byByZXNwb25kCi0gICAgICAgICAgICAgICAgICAg ICB0byBmb2N1cyBjaGFuZ2UgZXZlbnRzIChpZiBFbWFjcyB3YXMgYWN0aXZlIGFwcCkuICAqLwot ICAgICAgICAgICAgICAgICAgU2xlZXAgKDEwMCk7Ci0KLSAgICAgICAgICAgICAgICAgIFNldEZv cmVncm91bmRXaW5kb3cgKGZvcmVncm91bmRfd2luZG93KTsKLSAgICAgICAgICAgICAgICB9Ci0g ICAgICAgICAgICAgIC8qIERldGFjaCBmcm9tIHRoZSBmb3JlZ3JvdW5kIGFuZCBjaGlsZCB0aHJl YWRzIG5vdyB0aGF0Ci0gICAgICAgICAgICAgICAgIHRoZSBmb3JlZ3JvdW5kIHN3aXRjaGluZyBp cyBvdmVyLiAgKi8KLSAgICAgICAgICAgICAgaWYgKGZvcmVncm91bmRfdGhyZWFkKQotICAgICAg ICAgICAgICAgIEF0dGFjaFRocmVhZElucHV0IChHZXRDdXJyZW50VGhyZWFkSWQgKCksCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZvcmVncm91bmRfdGhyZWFkLCBGQUxTRSk7 Ci0gICAgICAgICAgICAgIGlmIChjaGlsZF90aHJlYWQpCi0gICAgICAgICAgICAgICAgQXR0YWNo VGhyZWFkSW5wdXQgKEdldEN1cnJlbnRUaHJlYWRJZCAoKSwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgY2hpbGRfdGhyZWFkLCBGQUxTRSk7Ci0gICAgICAgICAgICB9Ci0gICAg ICAgIH0KKwkJICBrZXliZF9ldmVudCAodmtfYnJlYWtfY29kZSwgYnJlYWtfc2Nhbl9jb2RlLAor CQkgICAgKHZrX2JyZWFrX2NvZGUgPT0gJ0MnID8gMCA6IEtFWUVWRU5URl9FWFRFTkRFREtFWSkK KwkJICAgIHwgS0VZRVZFTlRGX0tFWVVQLCAwKTsKKwkJICBrZXliZF9ldmVudCAoVktfQ09OVFJP TCwgY29udHJvb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HMtPmhkYywgY2xpcDEpOwogICAgICAgRGVsZXRlT2JqZWN0IChj bGlwMSk7CiAgICAgICBEZWxldGVPYmplY3QgKGNsaXAyKTsKICAgICB9CkBAIC0zMTEsMTAgKzMx MSwxMCBAQCB3MzJfcmVzdG9yZV9nbHlwaF9zdHJpbmdfY2xpcCAoc3RydWN0IGdseXBoX3N0cmlu ZyAqcykKIC8qCiAgICBEcmF3IGEgd2F2eSBsaW5lIHVuZGVyIFMuIFRoZSB3YXZlIGZpbGxzIHdh dmVfaGVpZ2h0IHBpeGVscyBmcm9tIHkwLgogCi0gICAgICAgICAgICAgICAgICAgIHgwICAgICAg ICAgd2F2ZV9sZW5ndGggPSAyCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAtLQot ICAgICAgICAgICAgICAgIHkwICAgKiAgICogICAqICAgKiAgICoKLSAgICAgICAgICAgICAgICAg ICAgIHwqICogKiAqICogKiAqICogKgorCQkgICAgeDAgICAgICAgICB3YXZlX2xlbmd0aCA9IDIK KwkJCQkgLS0KKwkJeTAgICAqICAgKiAgICogICAqICAgKgorCQkgICAgIHwqICogKiAqICogKiAq ICogKgogICAgIHdhdmVfaGVpZ2h0ID0gMyAgfCAqICAgKiAgICogICAqCiAKICovCkBAIC0zODQs NyArMzg0LDcgQEAgdzMyX2RyYXdfdW5kZXJ3YXZlIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzLCBD T0xPUlJFRiBjb2xvcikKIC8qIERyYXcgYSBob2xsb3cgcmVjdGFuZ2xlIGF0IHRoZSBzcGVjaWZp ZWQgcG9zaXRpb24uICAqLwogc3RhdGljIHZvaWQKIHczMl9kcmF3X3JlY3RhbmdsZSAoSERDIGhk YywgWEdDVmFsdWVzICpnYywgaW50IHgsIGludCB5LAotICAgICAgICAgICAgICAgICAgICBpbnQg d2lkdGgsIGludCBoZWlnaHQpCisJCSAgICBpbnQgd2lkdGgsIGludCBoZWlnaHQpCiB7CiAgIEhC UlVTSCBoYiwgb2xka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ICAgICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQpOwor CQkJCSAgICAgICBpbnQsIGludCwgaW50KTsKIHN0YXRpYyB2b2lkIHczMl9kcmF3X3JlbGllZl9y ZWN0IChzdHJ1Y3QgZnJhbWUgKiwgaW50LCBpbnQsIGludCwgaW50LAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGludCwgaW50LCBpbnQsIGludCwgaW50LCBpbnQsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgUkVDVCAqKTsKKwkJCQkgIGludCwgaW50LCBpbnQs IGludCwgaW50LCBpbnQsCisJCQkJICBSRUNUICopOwogc3RhdGljIHZvaWQgdzMyX2RyYXdfYm94 X3JlY3QgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwgaW50LCBpbnQsIGludCwgaW50LAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGludCwgYm9vbCwgYm9vbCwgUkVDVCAqKTsKKwkJCSAg ICAgICBpbnQsIGJvb2wsIGJvb2wsIFJFQ1QgKik7CiAKIAogLyogU2V0IFMtPmdjIHRvIGEgc3Vp dGFibGUgR0MgZm9yIGRyYXdpbmcgZ2x5cGggc3RyaW5nIFMgaW4gY3Vyc29yCkBAIC0xMTAyLDcg KzExMDIsNyBAQCB4X3NldF9nbHlwaF9zdHJpbmdfY2xpcHBpbmcgKHN0cnVjdCBnbHlwaF9zdHJp bmcgKnMpCiAgICAgICBIUkdOIGNsaXAxID0gQ3JlYXRlUmVjdFJnbkluZGlyZWN0IChyKTsKICAg ICAgIEhSR04gY2xpcDIgPSBDcmVhdGVSZWN0UmduSW5kaXJlY3QgKHIgKyAxKTsKICAgICAgIGlm IChDb21iaW5lUmduIChjbGlwMSwgY2xpcDEsIGNsaXAyLCBSR05fT1IpICE9IEVSUk9SKQotICAg ICAgICBTZWxlY3RDbGlwUmduIChzLT5oZGMsIGNsaXAxKTsKKwlTZWxlY3RDbGlwUmduIChzLT5o ZGMsIGNsa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aWYgKHMtPmZhY2UtPnVu ZGVybGluZV9kZWZhdWx0ZWRfcCkKLSAgICAgICAgICAgICAgICBjb2xvciA9IHMtPmdjLT5mb3Jl Z3JvdW5kOwotICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgY29sb3IgPSBzLT5m YWNlLT51bmRlcmxpbmVfY29sb3I7Ci0KLSAgICAgICAgICAgICAgdzMyX2RyYXdfdW5kZXJ3YXZl IChzLCBjb2xvcik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZSBpZiAocy0+ZmFjZS0+ dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQotICAgICAgICAgICAgewotICAgICAg ICAgICAgICB1bnNpZ25lZCBsb25nIHRoaWNrbmVzcywgcG9zaXRpb247Ci0gICAgICAgICAgICAg IGludCB5OwotCi0gICAgICAgICAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVu ZGVybGluZV9wCisJeworCSAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5E RVJfV0FWRSkKKwkgICAgeworCSAgICAgIENPTE9SUkVGIGNvbG9yOworCisJICAgICAgaWYgKHMt PmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKKwkJY29sb3IgPSBzLT5nYy0+Zm9yZWdyb3Vu ZDsKKwkgICAgICBlbHNlCisJCWNvbG9yID0gcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yOworCisJ ICAgICAgdzMyX2RyYXdfdW5kZXJ3YXZlIChzLCBjb2xvcik7CisJICAgIH0KKwkgIGVsc2UgaWYg KHMtPmZhY2UtPnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKKwkgICAgeworCSAg ICAgIHVuc2lnbmVkIGxvbmcgdGhpY2tuZXNzLCBwb3NpdGlvbjsKKwkgICAgICBpbnQgeTsKKwor CSAgICAgIGlmIChzLT5wcmV2ICYmIHMtPnByZXYtPmZhY2UtPnVuZGVybGluZV9wCiAJCSAgJiYg cy0+cHJldi0+ZmFjZS0+dW5kZXJsaW5lX3R5cGUgPT0gRkFDRV9VTkRFUl9MSU5FKQotICAgICAg ICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIC8qIFdlIHVzZSB0aGUgc2FtZSB1bmRlcmxp bmUgc3R5bGUgYXMgdGhlIHByZXZpb3VzIG9uZS4gICovCi0gICAgICAgICAgICAgICAgICB0aGlj a25lc3MgPSBzLT5wcmV2LT51bmRlcmxpbmVfdGhpY2tuZXNzOwotICAgICAgICAgICAgICAgICAg cG9zaXRpb24gPSBzLT5wcmV2LT51bmRlcmxpbmVfcG9zaXRpb247Ci0gICAgICAgICAgICAgICAg fQotICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAgRGVmYXVsdCBpcyAxIHBpeGVsLiAg Ki8KLSAgICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGluZV90 aGlja25lc3MgPiAwKQotICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSBzLT5mb250LT51 bmRlcmxpbmVfdGhpY2tuZXNzOwotICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAg ICAgICAgICB0aGlja25lc3MgPSAxOwotICAgICAgICAgICAgICAgICAgaWYgKHhfdW5kZXJsaW5l X2F0X2Rlc2NlbnRfbGluZSkKLSAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSAocy0+aGVp Z2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAtIHMtPnkpOwotICAgICAgICAgICAgICAgICAg ZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgLyogR2V0 IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlzIGlzIHRoZSByZWNvbW1lbmRlZAotICAgICAg ICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9mZnNldCBpbiBwaXhlbHMgZnJvbSB0aGUgYmFz ZWxpbmUgdG8gdGhlIHRvcCBvZgotICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSB1bmRlcmxp bmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFjY29yZGluZyB0byB0aGUKLSAgICAgICAgICAg ICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0IGlzCi0KLSAgICAgICAgICAgICAg ICAgICAgICAgICBST1VORCAoKG1heGltdW1fZGVzY2VudCkgLyAyKSwgd2l0aAotICAgICAgICAg ICAgICAgICAgICAgICAgIFJPVU5EICh4KSA9IGZsb29yICh4ICsgMC41KSAgKi8KLQotICAgICAg ICAgICAgICAgICAgICAgIGlmICh4X3VzZV91bmRlcmxpbmVfcG9zaXRpb25fcHJvcGVydGllcwot ICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBzLT5mb250ICYmIHMtPmZvbnQtPnVuZGVybGlu ZV9wb3NpdGlvbiA+PSAwKQotICAgICAgICAgICAgICAgICAgICAgICAgcG9zaXRpb24gPSBzLT5m b250LT51bmRlcmxpbmVfcG9zaXRpb247Ci0gICAgICAgICAgICAgICAgICAgICAgZWxzZSBpZiAo cy0+Zm9udCkKLSAgICAgICAgICAgICAgICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmZvbnQtPmRl c2NlbnQgKyAxKSAvIDI7Ci0gICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAg IHBvc2l0aW9uID0gbWF4IChwb3NpdGlvbiwgdW5kZXJsaW5lX21pbmltdW1fb2Zmc2V0KTsKLSAg ICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICAgIC8qIENoZWNrIHRoZSBzYW5pdHkgb2YgdGhp Y2tuZXNzIGFuZCBwb3NpdGlvbi4gIFdlIHNob3VsZAotICAgICAgICAgICAgICAgICBhdm9pZCBk cmF3aW5nIHVuZGVybGluZSBvdXQgb2YgdGhlIGN1cnJlbnQgbGluZSBhcmVhLiAgKi8KLSAgICAg ICAgICAgICAgaWYgKHMtPnkgKyBzLT5oZWlnaHQgPD0gcy0+eWJhc2UgKyBwb3NpdGlvbikKLSAg ICAgICAgICAgICAgICBwb3NpdGlvbiA9IChzLT5oZWlnaHQgLSAxKSAtIChzLT55YmFzZSAtIHMt PnkpOwotICAgICAgICAgICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8IHMtPnliYXNlICsgcG9z aXRpb24gKyB0aGlja25lc3MpCi0gICAgICAgICAgICAgICAgdGhpY2tuZXNzID0gKHMtPnkgKyBz LT5oZWlnaHQpIC0gKHMtPnliYXNlICsgcG9zaXRpb24pOwotICAgICAgICAgICAgICBzLT51bmRl cmxpbmVfdGhpY2tuZXNzID0gdGhpY2tuZXNzOwotICAgICAgICAgICAgICBzLT51bmRlcmxpbmVf cG9zaXRpb24gPXBvc2l0aW9uOwotICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlv bjsKLSAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKLSAg ICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBz LT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAg ICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHczMl9maWxsX2Fy ZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+dW5kZXJsaW5lX2NvbG9yLCBzLT54LAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgeSwgcy0+d2lkdGgsIDEpOwotICAgICAgICAgICAg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kJICB3 MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAorCQkJ CSB5LCBzLT53aWR0aCwgMSk7CisJCX0KKwkgICAgICBlbHNlCisJCXsKKwkJICB3MzJfZmlsbF9h cmVhIChzLT5mLCBzLT5oZGMsIHMtPmZhY2UtPnVuZGVybGluZV9jb2xvciwgcy0+eCwKKwkJCQkg eSwgcy0+d2lkdGgsIDEpOworCQl9CisJICAgIH0KKwl9CiAgICAgICAvKiBEcmF3IG92ZXJsaW5l LiAgKi8KICAgICAgIGlmIChzLT5mYWNlLT5vdmVybGluZV9wKQotICAgICAgICB7Ci0gICAgICAg ICAgdW5zaWduZWQgbG9uZyBkeSA9IDAsIGggPSAxOwotCi0gICAgICAgICAgaWYgKHMtPmZhY2Ut Pm92ZXJsaW5lX2NvbG9yX2RlZmF1bHRlZF9wKQotICAgICAgICAgICAgewotICAgICAgICAgICAg ICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3JvdW5kLCBzLT54LAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKLSAg ICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAg IHczMl9maWxsX2FyZWEgKHMtPmYsIHMtPmhkYywgcy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3IsIHMt PngsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIHMtPnkgKyBkeSwgcy0+d2lkdGgsIGgp OwotICAgICAgICAgICAgfQotICAgICAgICB9CisJeworCSAgdW5zaWduZWQgbG9uZyBkeSA9IDAs IGggPSAxOworCisJICBpZiAocy0+ZmFjZS0+b3ZlcmxpbmVfY29sb3JfZGVmYXVsdGVkX3ApCisJ ICAgIHsKKwkgICAgICB3MzJfZmlsbF9hcmVhIChzLT5mLCBzLT5oZGMsIHMtPmdjLT5mb3JlZ3Jv dW5kLCBzLT54LAorCQkJICAgICBzLT55ICsgZHksIHMtPndpZHRoLCBoKTsKKwkgICAgfQorCSAg ZWxzZQorCSAgICB7CisJICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+Ziwgcy0+aGRjLCBzLT5mYWNl LT5vdmVybGluZV9jb2xvciwgcy0+eCwKKwkJCSAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7 CisJICAgIH0KKwl9CiAKICAgICAgIC8qIERyYXcgc3RyaWtlLXRocm91Z2guICAqLwogICAgICAg aWYgKHMtPmZhY2UtPnN0cmlrZV90aHJvdWdoX3AKLSAgICAgICAgICAmJiAhRk9OVF9URVhUTUVU UklDIChzLT5mb250KS50bVN0cnVja091dCkKLSAgICAgICAgewotICAgICAgICAgIHVuc2lnbmVk IGxvbmcgaCA9IDE7Ci0gICAgICAgICAgdW5zaWduZWQgbG9uZyBkeSA9IChzLT5oZWlnaHQgLSBo KSAvIDI7Ci0KLSAgICAgICAgICBpZiAocy0+ZmFjZS0+c3RyaWtlX3Rocm91Z2hfY29sb3JfZGVm YXVsdGVkX3ApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHczMl9maWxsX2FyZWEgKHMt PmYsIHMtPmhkYywgcy0+Z2MtPmZvcmVncm91bmQsIHMtPngsIHMtPnkgKyBkeSwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+d2lkdGgsIGgpOwotICAgICAgICAgICAgfQotICAgICAg ICAgIGVsc2UKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgdzMyX2ZpbGxfYXJlYSAocy0+ Ziwgcy0+aGRjLCBzLT5mYWNlLT5zdHJpa2VfdGhyb3VnaF9jb2xvciwgcy0+eCwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eSArIGR5LCBzLT53aWR0aCwgaCk7Ci0gICAgICAgICAg ICB9Ci0gICAgICAgIH0KKwkgICYmICFGT05UX1RFWF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IT0gZnJhbWUpCi0gICAgICAgIHsK LSAgICAgICAgICB4X25ld19mb2N1c19mcmFtZSAoZHB5aW5mbywgZnJhbWUpOwotICAgICAgICAg IGRweWluZm8tPnczMl9mb2N1c19ldmVudF9mcmFtZSA9IGZyYW1lOwotCi0gICAgICAgICAgLyog RG9uJ3Qgc3RvcCBkaXNwbGF5aW5nIHRoZSBpbml0aWFsIHN0YXJ0dXAgbWVzc2FnZQotICAgICAg ICAgICAgIGZvciBhIHN3aXRjaC1mcmFtZSBldmVudCB3ZSBkb24ndCBuZWVkLiAgKi8KLSAgICAg ICAgICBpZiAoTklMUCAoVnRlcm1pbmFsX2ZyYW1lKQotICAgICAgICAgICAgICAmJiBDT05TUCAo VmZyYW1lX2xpc3QpCi0gICAgICAgICAgICAgICYmICFOSUxQIChYQ0RSIChWZnJhbWVfbGlzdCkp KQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBidWZwLT5hcmcgPSBRdDsKLSAgICAgICAg ICAgIH0KLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGJ1ZnAt PmFyZyA9IFFuaWw7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICBidWZwLT5raW5kID0gRk9D VVNfSU5fRVZFTlQ7Ci0gICAgICAgICAgWFNFVEZSQU1FIChidWZwLT5mcmFtZV9vcl93aW5kb3cs IGZyYW1lKTsKLSAgICAgICAgfQorCXsKKwkgIHhfbmV3X2ZvY3VzX2ZyYW1lIChkcHlpbmZvLCBm cmFtZSk7CisJICBkcHlpbmZvLT53MzJfZm9jdXNfZXZlbnRfZnJhbWUgPSBmcmFtZTsKKworCSAg LyogRG9uJ3Qgc3RvcCBkaXNwbGF5aW5nIHRoZSBpbml0aWFsIHN0YXJ0dXAgbWVzc2FnZQorCSAg ICAgZm9yIGEgc3dpdGNoLWZyYW1lIGV2ZW50IHdlIGRvbid0IG5lZWQuICAqLworCSAgaWYgKE5J TFAgKFZ0ZXJtaW5hbF9m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ik7CiAJICAgICAgaW5ldi50aW1lc3Rh bXAgPSBtc2cubXNnLnRpbWU7CiAKLSAgICAgICAgICAgICAgaWYgKG1zZy5tc2cubWVzc2FnZSA9 PSBXTV9VTklDSEFSKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIGluZXYu Y29kZSA9IG1zZy5tc2cud1BhcmFtOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAg ZWxzZSBpZiAobXNnLm1zZy53UGFyYW0gPCAyNTYpCi0gICAgICAgICAgICAgICAgewotICAgICAg ICAgICAgICAgICAgd2NoYXJfdCBjb2RlOwotICAgICAgICAgICAgICAgICAgY2hhciBkYmNzWzJd OwotICAgICAgICAgICAgICAgICAgZGJjc1swXSA9IDA7Ci0gICAgICAgICAgICAgICAgICBkYmNz WzFdID0gKGNoYXIpIG1zZy5tc2cud1BhcmFtOwotCi0gICAgICAgICAgICAgICAgICBpZiAoZGJj c19sZWFkKQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgZGJj c1swXSA9IGRiY3NfbGVhZDsKLSAgICAgICAgICAgICAgICAgICAgICBkYmNzX2xlYWQgPSAwOwot ICAgICAgICAgICAgICAgICAgICAgIGlmICghTXVsdGlCeXRlVG9XaWRlQ2hhciAodzMyX2tleWJv YXJkX2NvZGVwYWdlLCAwLAorCSAgICAgIGlmIChtc2cubXNnLm1lc3NhZ2UgPT0gV01fVU5JQ0hB UikKKwkJeworCQkgIGluZXYuY29kZSA9IG1zZy5tc2cud1BhcmFtOworCQl9CisJICAgICAgZWxz ZSBpZiAobXNnLm1zZy53UGFyYW0gPCAyNTYpCisJCXsKKwkJICB3Y2hhcl90IGNvZGU7CisJCSAg Y2hhciBkYmNzWzJdOworCQkgIGRiY3NbMF0gPSAwOworCQkgIGRiY3NbMV0gPSAoY2hhcikgbXNn Lm1zZy53UGFyYW07CisKKwkJICBpZiAoZGJjc19sZWFkKQorCQkgICAgeworCQkgICAgICBkYmNz WzBdID0gZGJjc19sZWFkOworCQkgICAgICBkYmNzX2xlYWQgPSAwOworCQkgICAgICBpZiAoIU11 bHRpQnl0ZVRvV2lkZUNoYXIgKHczMl9rZXlib2FyZF9jb2RlcGFnZSwgMCwKIAkJCQkJCWRiY3Ms IDIsICZjb2RlLCAxKSkKLSAgICAgICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgLyogR2FyYmFnZSAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICBEZWJQ cmludCAoKCJJbnZhbGlkIERCQ1Mgc2VxdWVuY2U6ICVkICVkXG4iLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGRiY3NbMF0sIGRiY3NbMV0pKTsKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgaW5ldi5raW5kID0gTk9fRVZFTlQ7Ci0gICAgICAgICAgICAgICAgICAgICAg ICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAg ICB9Ci0gICAgICAgICAgICAgICAgICBlbHNlIGlmIChJc0RCQ1NMZWFkQnl0ZUV4ICh3MzJfa2V5 Ym9hcmRfY29kZXBhZ2UsCisJCQl7CisJCQkgIC8qIEdhcmJhZ2UgKi8KKwkJCSAgRGViUHJpbnQg KCgiSW52YWxpZCBEQkNTIHNlcXVlbmNlOiAlZCAlZFxuIiwKKwkJCQkgICAgIGRiY3NbMF0sIGRi Y3NbMV0pKTsKKwkJCSAgaW5ldi5raW5kID0gTk9fRVZFTlQ7CisJCQkgIGJyZWFrOworCQkJfQor CQkgICAgfQorCQkgIGVsc2UgaWYgKElzREJDU0xlYWRCeXRlRXggKHczMl9rZXlib2FyZF9jb2Rl cGFnZSwKIAkJCQkJICAgICAoQllURSkgbXNnLm1zZy53UGFyYW0pKQotICAgICAgICAgICAgICAg ICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgZGJjc19sZWFkID0gKGNoYXIpIG1zZy5tc2cu d1BhcmFtOwotICAgICAgICAgICAgICAgICAgICAgIGluZXYua2luZCA9IE5PX0VWRU5UOwotICAg ICAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAgICAg ICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg ICAgICBpZiAoIU11bHRpQnl0ZVRvV2lkZUNoYXIgKHczMl9rZXlib2FyZF9jb2RlcGFnZSwgMCwK KwkJICAgIHsKKwkJICAgICAgZGJjc19sZWFkID0gKGNoYXIpIG1zZy5tc2cud1BhcmFtOworCQkg ICAgICBpbmV2LmtpbmQgPSBOT19FVkVOVDsKKwkJICAgICAgYnJlYWs7CisJCSAgICB9CisJCSAg ZWxzZQorCQkgICAgeworCQkgICAgICBpZiAoIU11bHRpQnl0ZVRvV2lkZUNoYXIgKHczMl9rZXli b2FyZF9jb2RlcGFnZSwgMCwKIAkJCQkJCSZkYmNzWzFdLCAxLCAmY29kZSwgMSkpCi0gICAgICAg ICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgICAgIC8qIFdoYXQgdG8g ZG8gd2l0aCBnYXJiYWdlPyAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICBEZWJQcmludCAo KCJJbnZhbGlkIGNoYXJhY3RlcjogJWRcbiIsIGRiY3NbMV0pKTsKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgaW5ldi5raW5kID0gTk9fRVZFTlQ7Ci0gICAgICAgICAgICAgICAgICAgICAgICAg IGJyZWFrOwotICAgICAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgICB9 Ci0gICAgICAgICAgICAgICAgICBpbmV2LmNvZGUgPSBjb2RlOwotICAgICAgICAgICAgICAgIH0K LSAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAg IC8qIFdpbmRvd3Mgc2hvdWxkbid0IGdlbmVyYXRlIFdNX0NIQVIgZXZlbnRzIGFib3ZlIDB4RkYK LSAgICAgICAgICAgICAgICAgICAgIGluIG5vbi1Vbmljb2RlIG1lc3NhZ2UgaGFuZGxlcnMuICAq LwotICAgICAgICAgICAgICAgICAgRGViUHJpbnQgKCgiTm9uLWJ5dGUgV01fQ0hBUjogJWRcbiIs IG1zZy5tc2cud1BhcmFtKSk7Ci0gICAgICAgICAgICAgICAgICBpbmV2LmtpbmQgPSBOT19FVkVO VDsKLSAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAg ICAgICAgaW5ldi5raW5kID0gaW5ldi5jb2RlIDwgMTI4ID8gQVNDSUlfS0VZU1RST0tFX0VWRU5U Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA6IE1VTFRJQllURV9D SEFSX0tFWVNUUk9LRV9FVkVOVDsKKwkJCXsKKwkJCSAgLyogV2hhdCB0byBkbyB3aXRoIGdhcmJh Z2U/ICovCisJCQkgIERlYlByaW50ICgoIkludmFsaWQgY2hhcmFjdGVyOiAlZFxuIiwgZGJjc1sx XSkpOworCQkJICBpbmV2LmtpbmQgPSBOT19FVkVOVDsKKwkJCSAgYnJlYWs7CisJCQl9CisJCSAg ICB9CisJCSAgaW5ldi5jb2RlID0gY29kZTsKKwkJfQorCSAgICAgIGVsc2UKKwkJeworCQkgIC8q IFdpbmRvd3Mgc2hvdWxkbid0IGdlbmVyYXRlIFdNX0NIQVIgZXZlbnRzIGFib3ZlIDB4RkYKKwkJ ICAgICBpbiBub24tVW5pY29kZSBtZXNzYWdlIGhhbmRsZXJzLiAgKi8KKwkJICBEZWJQcmludCAo KCJOb24tYnl0ZSBXTV9DSEFSOiAlZFxuIiwgbXNnLm1zZy53UGFyYW0pKTsKKwkJICBpbmV2Lmtp bmQgPSBOT19FVkVOVDsKKwkJICBicmVhazsKKwkJfQorCSAgICAgIGluZXYua2luZCA9IGluZXYu Y29k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N0cnVjdF9tb3VzZV9jbGljayAoJmluZXYsICZtc2csIGYpOwog Ci0gICAgICAgICAgICAgICAgLyogSXMgdGhpcyBpbiB0aGUgdG9vbC1iYXI/ICAqLwotICAgICAg ICAgICAgICAgIGlmIChXSU5ET1dQIChmLT50b29sX2Jhcl93aW5kb3cpCi0gICAgICAgICAgICAg ICAgICAgICYmIFdJTkRPV19UT1RBTF9MSU5FUyAoWFdJTkRPVyAoZi0+dG9vbF9iYXJfd2luZG93 KSkpCi0gICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0 IHdpbmRvdzsKKwkJLyogSXMgdGhpcyBpbiB0aGUgdG9vbC1iYXI/ICAqLworCQlpZiAoV0lORE9X UCAoZi0+dG9vbF9iYXJfd2luZG93KQorCQkgICAgJiYgV0lORE9XX1RPVEFMX0xJTkVTIChYV0lO RE9XIChmLT50b29sX2Jhcl93aW5kb3cpKSkKKwkJICB7CisJCSAgICBMaXNwX09iamVjdCB3aW5k b3c7CiAJCSAgICBpbnQgeCA9IFhGQVNUSU5UIChpbmV2LngpOwogCQkgICAgaW50IHkgPSBYRkFT VElOVCAoaW5ldi55KTsKIAotICAgICAgICAgICAgICAgICAgICB3aW5kb3cgPSB3aW5kb3dfZnJv bV9jb29yZGluYXRlcyAoZiwgeCwgeSwgMCwgMSk7CisJCSAgICB3aW5kb3cgPSB3aW5kb3dfZnJv bV9jb29yZGluYXRlcyAoZiwgeCwgeSwgMCwgMSk7CiAKLSAgICAgICAgICAgICAgICAgICAgaWYg KEVRICh3aW5kb3csIGYtPnRvb2xfYmFyX3dpbmRvdykpCi0gICAgICAgICAgICAgICAgICAgICAg ewotICAgICAgICAgICAgICAgICAgICAgICAgdzMyX2hhbmRsZV90b29sX2Jhcl9jbGljayAoZiwg JmluZXYpOwotICAgICAgICAgICAgICAgICAgICAgICAgdG9vbF9iYXJfcCA9IDE7Ci0gICAgICAg ICAgICAgICAgICAgICAgfQotICAgICAgICAg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ICAgZWxzZSBpZiAoY2ggIT0gJyAnKQogICAgICAgewotICAgICAgICAqY3VycmVu dCsrID0gY2g7Ci0gICAgICAgIGlmIChpbl9vcHRpb24gJiYgKGNoID09ICc6JykpCi0gICAgICAg ICAgewotICAgICAgICAgICAgaW5fb3B0aW9uID0gMDsKLSAgICAgICAgICAgIGJlZm9yZV92YWx1 ZSA9IDE7Ci0gICAgICAgICAgfQotICAgICAgICBlbHNlIGlmIChiZWZvcmVfdmFsdWUpCi0gICAg ICAgICAgewotICAgICAgICAgICAgYmVmb3JlX3ZhbHVlID0gMDsKLSAgICAgICAgICB9CisJKmN1 cnJlbnQrKyA9IGNoOworCWlmIChpbl9vcHRpb24gJiYgKGNoID09ICc6JykpCisJICB7CisJICAg IGluX29wdGlvbiA9IDA7CisJICAgIGJlZm9yZV92YWx1ZSA9IDE7CisJICB9CisJZWxzZSBpZiAo YmVmb3JlX3ZhbHVlKQorCSAgeworCSAgICBiZWZvcmVfdmFsdWUgPSAwOworCSAgfQogICAgICAg fQogICAgIGVsc2UgaWYgKCEoaW5fb3B0aW9uIHx8IGJlZm9yZV92YWx1ZSkpCiAgICAgICB7Ci0g ICAgICAgICpjdXJyZW50KysgPSBjaDsKKwkqY3VycmVudCsrID0gY2g7CiAgICAgICB9CiAgIH0g d2hpbGUgKGNoKTsKIApAQCAtNzA1MSw4ICs3MDUxLDggQEAgdzMyX2luaXRpYWxpemUgKHZvaWQp CiAgICAgUGVla01lc3NhZ2UgKCZtc2csIE5VTEwsIDAsIDAsIFBNX05PUkVNT1ZFKTsKIAogICAg IGhXaW5kb3dzVGhyZWFkID0gQ3JlYXRlVGhyZWFkIChOVUxMLCAwLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB3MzJfbXNnX3dvcmtlciwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgMCwgMCwgJmR3V2luZG93c1RocmVhZElkKTsKKwkJCQkgICB3MzJfbXNn X3dvcmtlciwKKwkJCQk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ICAg ICAgICAgICAgewotICAgICAgICAgICAgICAvKiBVc2Ugc2VsZWN0ZWQgZnJhbWUgdW50aWwgQVBJ IGlzIHVwZGF0ZWQgdG8gcGFzcwotICAgICAgICAgICAgICAgICB0aGUgZnJhbWUuICAqLwotICAg ICAgICAgICAgICBmID0gWEZSQU1FIChzZWxlY3RlZF9mcmFtZSk7Ci0gICAgICAgICAgICAgIGNv bnRleHQgPSBnZXRfZnJhbWVfZGMgKGYpOwotICAgICAgICAgICAgICBvbGRfZm9udCA9IFNlbGVj dE9iamVjdCAoY29udGV4dCwgRk9OVF9IQU5ETEUgKGZvbnQpKTsKLSAgICAgICAgICAgICAgcmVz dWx0ID0gU2NyaXB0U2hhcGUgKGNvbnRleHQsICYodW5pc2NyaWJlX2ZvbnQtPmNhY2hlKSwKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNoLCBsZW4sIDIsICYoaXRlbXNbMF0u YSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBnbHlwaHMsIGNsdXN0ZXJz LCBhdHRycywgJm5nbHlwaHMpOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgaWYgKFNVQ0NF RURFRCAocmVzdWx0KSAmJiBuZ2x5cGhzID09IDEpCi0gICAgICAgICAgICB7CisJICByZXN1bHQg PSBTY3JpcHRTaGFwZSAoY29udGV4dCwgJih1bmlzY3JpYmVfZm9udC0+Y2FjaGUpLAorCQkJCWNo LCBsZW4sIDIsICYoaXRlbXNbMF0uYSksCisJCQkJZ2x5cGhzLCBjbHVzdGVycywgYXR0cnMsICZu Z2x5cGhzKTsKKworCSAgaWYgKHJlc3VsdCA9PSBFX1BFTkRJTkcpCisJICAgIHsKKwkgICAgICAv KiBVc2Ugc2VsZWN0ZWQgZnJhbWUgdW50aWwgQVBJIGlzIHVwZGF0ZWQgdG8gcGFzcworCQkgdGhl IGZyYW1lLiAgKi8KKwkgICAgICBmID0gWEZSQU1FIChzZWxlY3RlZF9mcmF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naW5lIHRvIGJlIGludm9rZWQKLSAgICAgICAgICAgICAgICAgbGF0 ZXIuICAqLwotICAgICAgICAgICAgICByZXN1bHQgPSBTY3JpcHRHZXRDTWFwIChjb250ZXh0LCAm KHVuaXNjcmliZV9mb250LT5jYWNoZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGNoLCBsZW4sIDAsIGdseXBocyk7Ci0gICAgICAgICAgICAgIGlmIChTVUNDRUVERUQg KHJlc3VsdCkgJiYgZ2x5cGhzWzBdKQotICAgICAgICAgICAgICAgIGNvZGUgPSBnbHlwaHNbMF07 Ci0gICAgICAgICAgICB9CisJICAgIH0KKwkgIGVsc2UgaWYgKFNVQ0NFRURFRCAocmVzdWx0KSB8 fCByZXN1bHQgPT0gRV9PVVRPRk1FTU9SWSkKKwkgICAgeworCSAgICAgIC8qIFRoaXMgY2hhcmFj dGVyIHByb2R1Y2VzIHplcm8gb3IgbW9yZSB0aGFuIG9uZSBnbHlwaAorCQkgd2hlbiBzaGFwZWQu IEJ1dCB3ZSBzdGlsbCBuZWVkIHRoZSByZXR1cm4gZnJvbSBoZXJlCisJCSB0byBiZSB2YWxpZCBm b3IgdGhlIHNoYXBpbmcgZW5naW5lIHRvIGJlIGludm9rZWQKKwkJIGxhdGVyLiAgKi8KKwkgICAg ICByZXN1bHQgPSBTY3JpcHRHZXRDTWFwIChjb250ZXh0LCAmKHVuaXNjcmliZV9mb250LT5jYWNo ZSksCisJCQkJICAgICAgY2gsIGxlbiwgMCwgZ2x5cGhzKTsKKwkgICAgICBpZiAoU1VDQ0VFREVE IChyZXN1bHQpICYmIGdseXBoc1swXSkKKwkJY29kZSA9IGdseXBoc1swXTsKKwkgICAgfQogCX0K ICAgICB9CiAgICAgaWYgKGNvbnRleHQpCkBAIC02MDMsMTggKzYwMywxOCBAQCB1bmlzY3JpYmVf ZW5jb2RlX2NoYXIgKHN0cnVjdCBmb250ICpmb250LCBpbnQgYykKICAgIHZvaWQgdW5pc2Nya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X2ZyZWVfYml0bWFwIChzdHJ1Y3QgZm9u dCAqZm9udCwgc3RydWN0IGZvbnRfYml0bWFwICpiaXRtYXApOwogICAgaW50IHVuaXNjcmliZV9h bmNob3JfcG9pbnQgKHN0cnVjdCBmb250ICpmb250LCB1bnNpZ25lZCBjb2RlLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIGludCBpbmRleCwgaW50ICp4LCBpbnQgKnkpOworCQkJICAg ICAgIGludCBpbmRleCwgaW50ICp4LCBpbnQgKnkpOwogICAgaW50IHVuaXNjcmliZV9zdGFydF9m b3JfZnJhbWUgKHN0cnVjdCBmcmFtZSAqZik7CiAgICBpbnQgdW5pc2NyaWJlX2VuZF9mb3JfZnJh bWUgKHN0cnVjdCBmcmFtZSAqZik7CiAKZGlmZiAtLWdpdCBhL3NyYy93MzJ4Zm5zLmMgYi9zcmMv dzMyeGZucy5jCmluZGV4IGI1YjIyYzkuLmM5MTJlODMgMTAwNjQ0Ci0tLSBhL3NyYy93MzJ4Zm5z LmMKKysrIGIvc3JjL3czMnhmbnMuYwpAQCAtMjI4LDQ1ICsyMjgsNDUgQEAgZ2V0X25leHRfbXNn IChXMzJNc2cgKiBscG1zZywgQk9PTCBiV2FpdCkKICAgICAgIG5RdWV1ZS0tOwogICAgICAgLyog Q29uc29saWRhdGUgV01fUEFJTlQgbWVzc2FnZXMgdG8gb3B0aW1pemUgcmVkcmF3aW5nLiAgKi8K ICAgICAgIGlmIChscG1zZy0+bXNnLm1lc3NhZ2UgPT0gV01fUEFJTlQgJiYgblF1ZXVlKQotICAg ICAgICB7Ci0gICAgICAgICAgaW50X21zZyAqIGxwQ3VyID0gbHBIZWFkOwotICAgICAgICAgIGlu dF9tc2cgKiBscFByZXYgPSBOVUxMOwotICAgICAgICAgIGludF9tc2cgKiBscE5leHQgPSBOVUxM OwotCi0gICAgICAgICAgd2hpbGUgKGxwQ3VyICYmIG5RdWV1ZSkKLSAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgbHBOZXh0ID0gbHBDdXItPmxwTmV4dDsKLSAgICAgICAgICAgICAgaWYgKGxw Q3VyLT53MzJtc2cubXNnLm1lc3NhZ2UgPT0gV01fUEFJTlQpCi0gICAgICAgICAgICAgICAgewot ICAgICAgICAgICAgICAgICAgLyogUmVtb3ZlIHRoaXMgbWVzc2FnZSBmcm9tIHRoZSBxdWV1ZS4g ICovCi0gICAgICAgICAgICAgICAgICBpZiAobHBQcmV2KQotICAgICAgICAgICAgICAgICAgICBs cFByZXYtPmxwTmV4dCA9IGxwTmV4dDsKLSAgICAgICAgICAgICAgICAgIGVsc2UKLSAgICAgICAg ICAgICAgICAgICAgbHBIZWFkID0gbHBOZXh0OwotCi0gICAgICAgICAgICAgICAgICBpZiAobHBD dXIgPT0gbHBUYWlsKQotICAgICAgICAgICAgICAgICAgICBscFRhaWwgPSBscFByZXY7Ci0KLSAg ICAgICAgICAgICAgICAgIC8qIEFkanVzdCBjbGlwIHJlY3RhbmdsZSB0byBjb3ZlciBib3RoLiAg Ki8KLSAgICAgICAgICAgICAgICAgIGlmICghVW5pb25SZWN0ICgmKGxwbXNnLT5yZWN0KSwgJihs cG1zZy0+cmVjdCksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgJihscEN1ci0+ dzMybXNnLnJlY3QpKSkKLSAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAg ICAgIFNldFJlY3RFbXB0eSAoJihscG1zZy0+cmVjdCkpOwotICAgICAgICAgICAgICAgICAgICB9 Ci0KLSAgICAgICAgICAgICAgICAgIG15ZnJlZSAobHBDdXIpOwotCi0gICAgICAgICAgICAgICAg ICBuUXVldWUtLTsKLQotICAgICAgICAgICAgICAgICAgbHBDdXIgPSBscE5leHQ7Ci0gICAgICAg ICAgICAgICAgfQotICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgewotICAgICAg ICAgICAgICAgICAgbHBQcmV2ID0gbHBDdXI7Ci0gICAgICAgICAgICAgICAgICBscEN1ciA9IGxw TmV4dDsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJ ICBpbnRfbXNnICogbHBDdXIgPSBscEhlYWQ7CisJICBpbnRfbXNnICogbHBQcmV2ID0gTlVMTDsK KwkgIGludF9tc2cgKiBscE5leHQgPSBOVUxMOworCisJICB3aGlsZSAobHBDdXIgJiYgblF1ZXVl KQorCSAgICB7CisJICAgICAgbHBOZXh0ID0gbHBDdXItPmxwTmV4dDsKKwkgICAgICBpZiAobHBD dXItPnczMm1zZy5tc2cubWVzc2FnZSA9PSBXTV9QQUlOVCkKKwkJeworCQkgIC8qIFJlbW92ZSB0 aGlzIG1lc3NhZ2UgZnJvbSB0aGUgcXVldWUuICAqLworCQkgIGlmIChscFByZXYpCisJCSAgICBs cFByZXYtPmxwTmV4dCA9IGxwTmV4dDsKKwkJICBlbHNlCisJCSAgICBscEhlYWQgPSBscE5leHQ7 CisKKwkJICBpZiAobHBDdXIgPT0gbHBUYWlsKQorCQkgICAgbHBUYWlsID0gbHBQcmV2OworCisJ CSAgLyogQWRqdXN0IGNsaXAgcmVjdGFuZ2xlIHRvIGNvdmVyIGJvdGguICAqLworCQkgIGlmICgh VW5pb25SZWN0ICgmKGxwbXNnLT5yZWN0KSwgJihscG1zZy0+cmVjdCksCisJCQkJICAmKGxwQ3Vy LT53MzJtc2cucmVjdCkpKQorCQkgICAgeworCQkgICAgICBTZXRSZWN0RW1wdHkgKCYobHBtc2ct PnJlY3QpKTsKKwkJICAgIH0KKworCQkgIG15ZnJlZSAobHBDdXIpOworCisJCSAgblF1ZXVlLS07 CisKKwkJICBscEN1ciA9IGxwTmV4dDsKKwkJfQorCSAgICAgIGVsc2UKKwkJeworCQkgIGxwUHJl diA9IGxwQ3VyOworCQkgIGxwQ3VyID0gbHBOZXh0OworCQl9CisJICAgIH0KKwl9CiAKICAgICAg IGJSZXQgPSBUUlVFOwogICAgIH0KZGlmZiAtLWdpdCBhL3N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XMvPi4g ICovCiAJICArLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLSsgICAgICAgICAgIHwK IAkgICAgRG9uJ3QgdXNlIHRoaXMgcGF0aCB3aGVuIGNhbGxlZAkJIHwKIAkgICAgYXN5bmNocm9u b3VzbHkhCQkJCSB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICBleHBvc2Vfd2luZG93 IChhc3luY2hyb25vdXMpICB8Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICB8Ci0JCQkgICAgICAgICAgIFggZXhwb3NlIGV2ZW50cyAgLS0t LS0rCisJCQkJCQkJIHwKKwkJCSAgIGV4cG9zZV93aW5kb3cgKGFzeW5jaHJvbm91cykgIHwKKwkJ CQkJCQkgfAorCQkJCSAgIFggZXhwb3NlIGV2ZW50cyAgLS0tLS0rCiAKICAgIFdoYXQgZG9lcyBy ZWRpc3BsYXkgZG8/ICBPYnZpb3VzbHksIGl0IGhhcyB0byBmaWd1cmUgb3V0IHNvbWVob3cgd2hh dAogICAgaGFzIGJlZW4gY2hhbmdlZCBzaW5jZSB0aGUgbGFzdCB0aW1lIHRoZSBkaXNwbGF5IGhh cyBiZWVuIHVwZGF0ZWQsCkBAIC04NDQsNyArODQ0LDcgQEAgc3RhdGljIHZvaWQgZGlzcGxheV9t ZW51X2JhciAoc3RydWN0IHdpbmRvdyAqKTsKIHN0YXRpYyBwdHJkaWZmX3QgZGlzcGxheV9jb3Vu dF9saW5lcyAocHRyZGlmZl90LCBwdHJkaWZmX3QsIHB0cmRpZmZfdCwKIAkJCQkgICAgICBwdHJk aWZmX3QgKik7CiBzdGF0aWMgaW50IGRpc3BsYXlfc3RyaW5nIChjb25zdCBjaGFyICosIExpc3Bf T2JqZWN0LCBMaXNwX09iamVjdCwKLSAgICAgICAgIC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zY3JvbGxfcmV0 cmllcysrOwotICAgICAgICAgICAgICAgICAgICAgICAgICBnb3RvIHJldHJ5X2ZyYW1lOwotICAg ICAgICAgICAgICAgICAgICAgICAgfQorCQkgICAgICBpZiAoaHNjcm9sbF9yZXRyaWVzIDw9IE1B WF9IU0NST0xMX1JFVFJJRVMKKwkJCSAgJiYgaHNjcm9sbF93aW5kb3dzIChmLT5yb290X3dpbmRv dykpCisJCQl7CisJCQkgIGhzY3JvbGxfcmV0cmllcysrOworCQkJICBnb3RvIHJldHJ5X2ZyYW1l OworCQkJfQogCQkgICAgfQogCiAJCSAgLyogSWYgdGhlIGZyYW1lJ3MgcmVkaXNwbGF5IGZsYWcg d2FzIG5vdCBzZXQgYmVmb3JlCkBAIC0xNDA4NCwyMyArMTQwODQsMjMgQEAgcmVkaXNwbGF5X2lu dGVybmFsICh2b2lkKQogCQkgICAgIHVzZSB0aGVtIGluIHVwZGF0ZV9mcmFtZSB3aWxsIHNlZ2Zh dWx0LgogCQkgICAgIFRoZXJlZm9yZSwgd2UgbXVzdCByZWRpc3BsYXkgdGhpcyBmcmFtZS4gICov CiAJCSAgaWYgKCFmX3JlZGlzcGxheV9mbGFnICYmIGYtPnJlZGlzcGxheSkKLSAgICAgICAgICAg ICAgICAgICAgZ290byByZXRyeV9mcmFtZTsKKwkJICAgIGdvdG8gcmV0cnlfZnJhbWU7CiAKLSAg ICAgICAgICAgICAgICAgIC8qIEluIHNvbWUgY2FzZSAoZS5nLiwgd2luZG93IHJlc2l6ZSksIHdl IG5vdGljZQotICAgICAgICAgICAgICAgICAgICAgb25seSBkdXJpbmcgd2luZG93IHVwZGF0aW5n IHRoYXQgdGhlIHdpbmRvdwotICAgICAgICAgICAgICAgICAgICAgY29udGVudCBjaGFuZ2VkIHVu cHJlZGljdGFibHkgKGUuZy4sIGEgR1RLCi0gICAgICAgICAgICAgICAgICAgICBzY3JvbGxiYXIg bW92ZWQpIGFuZCB0aGF0IG91ciBwcmV2aW91cyBlc3RpbWF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IC0xNzI2MSwxNCArMTcyNjEsMTQgQEAgcmVkaXNw bGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qgd2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKICNl bmRpZgogCX0KICAgICAgIGVsc2UKLSAgICAgICAgcmVkaXNwbGF5X21lbnVfcCA9IEZSQU1FX01F TlVfQkFSX0xJTkVTIChmKSA+IDA7CisJcmVkaXNwbGF5X21lbnVfcCA9IEZSQU1FX01FTlVfQkFS X0xJTkVTIChmKSA+IDA7CiAKICAgICAgIGlmIChyZWRpc3BsYXlfbWVudV9wKQotICAgICAgICBk aXNwbGF5X21lbnVfYmFyICh3KTsKKwlkaXNwbGF5X21lbnVfYmFyICh3KTsKIAogI2lmZGVmIEhB VkVfV0lORE9XX1NZU1RFTQogICAgICAgaWYgKEZSQU1FX1dJTkRPV19QIChmKSkKLSAgICAgICAg eworCXsKICNpZiBkZWZpbmVkIChVU0VfR1RLKSB8fCBkZWZpbmVkIChIQVZFX05TKQogCSAgaWYg KEZSQU1FX0VYVEVSTkFMX1RPT0xfQkFSIChmKSkKIAkgICAgcmVkaXNwbGF5X3Rvb2xfYmFyIChm KTsKQEAgLTE3Mjc5LDcgKzE3Mjc5LDcgQEAgcmVkaXNwbGF5X3dpbmRvdyAoTGlzcF9PYmplY3Qg d2luZG93LCBib29sIGp1c3RfdGhpc19vbmVfcCkKIAkgICAgICAmJiByZWRpc3BsYXlfdG9vbF9i YXIgKGYpKQogCSAgICBpZ25vcmVfbW91c2VfZHJhZ19wID0gdHJ1ZTsKICNlbmRpZgotICAgICAg ICB9CisJfQogICAgICAgeF9jb25zaWRlcl9mcmFtZV90aXRsZSAody0+ZnJhbWUpOwogI2VuZGlm CiAgICAgfQpAQCAtMTczMjgsNyArMTczMjgsNyBAQCByZWRpc3BsYXlfd2luZG93IChMaXNwX09i amVjdCB3aW5kb3csIGJvb2wganVzdF90aGlzX29uZV9wKQogICAgICAgLyogTm90ZSB0aGF0IHdl IGFjdHVh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ULCBFTkQsIEhFQUQsIFRBSUwsIEhMLCBY LCBMQVNUX1gpCVwKLSAgICAgICAgICAgIGNhc2UgWFdJREdFVF9HTFlQSDogICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKLSAgICAgICAgICAgICAgQlVJTERfWFdJREdF VF9HTFlQSF9TVFJJTkcgKFNUQVJULCBFTkQsIEhFQUQsIFRBSUwsICAgICAgIFwKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEhMLCBYLCBMQVNUX1gpOyAgICAgICAg ICAgICAgIFwKLSAgICAgICAgICAgICAgYnJlYWs7CisJICAgIGNhc2UgWFdJREdFVF9HTFlQSDog ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFwKKwkgICAgICBCVUlMRF9Y V0lER0VUX0dMWVBIX1NUUklORyAoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgICAgICAgXAorCQkJ CQkgIEhMLCBYLCBMQVNUX1gpOyAgICAgICAgICAgICAgIFwKKwkgICAgICBicmVhazsKIAogI2Rl ZmluZSBCVUlMRF9HTFlQSF9TVFJJTkdTXzIoU1RBUlQsIEVORCwgSEVBRCwgVEFJTCwgSEwsIFgs IExBU1RfWCkJXAogCSAgICBjYXNlIEdMWVBITEVTU19HTFlQSDoJCQkJCVwKQEAgLTI2MzAyLDcg KzI2MzAyLDcgQEAgcHJvZHVjZV9pbWFnZV9nbHlwaCAoc3RydWN0IGl0ICppdCkKIAkgICAgICBn bHlwaC0+cmlnaHRfYm94X2xpbmVfcCA9IGl0LT5lbmRfb2ZfYm94X3J1bl9wOwogCSAgICB9CiAJ ICBnbHlwaC0+b3ZlcmxhcHNfdmVydGljYWxseV9wID0gZmFsc2U7Ci0gICAgICAgICAgZ2x5cGgt PnBhZGRpbmdfcCA9IGZhbHNlOworCSAgZ2x5cGgtPnBhZGRpbmdfcCA9IGZhbHNlOwogCSAgZ2x5 cGgtPmdseXBoX25vdF9hdm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cGRhdGVkX3JvdywKICAgICB7CiAgICAgICBibG9j a19pbnB1dCAoKTsKICAgICAgIEZSQU1FX1JJRiAoZiktPmNsZWFyX2ZyYW1lX2FyZWEgKGYsIGZy b21feCwgZnJvbV95LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdG9f eCAtIGZyb21feCwgdG9feSAtIGZyb21feSk7CisJCQkJICAgICAgIHRvX3ggLSBmcm9tX3gsIHRv X3kgLSBmcm9tX3kpOwogICAgICAgdW5ibG9ja19pbnB1dCAoKTsKICAgICB9CiB9CkBAIC0yODIw Nyw3ICsyODIwNyw3IEBAIGdldF93aW5kb3dfY3Vyc29yX3R5cGUgKHN0cnVjdCB3aW5kb3cgKncs IHN0cnVjdCBnbHlwaCAqZ2x5cGgsIGludCAqd2lkdGgsCiAgIGlmICghdy0+Y3Vyc29yX29mZl9w KQogICAgIHsKICAgICAgIGlmIChnbHlwaCAhPSBOVUxMICYmIGdseXBoLT50eXBlID09IFhXSURH RVRfR0xZUEgpCi0gICAgICAgIHJldHVybiBOT19DVVJTT1I7CisJcmV0dXJuIE5PX0NVUlNPUjsK ICAgICAgIGlmIChnbHlwaCAhPSBOVUxMICYmIGdseXBoLT50eXBlID09IElNQUdFX0dMWVBIKQog CXsKIAkgIGlmIChjdXJzb3JfdHlwZSA9PSBGSUxMRURfQk9YX0NVUlNPUikKQEAgLTI4NjQzLDgg KzI4NjQzLDggQEAgZGlzcGxheV9hbmRfc2V0X2N1cnNvciAoc3RydWN0IHdpbmRvdyAqdywgYm9v bCBvbiwKICAgICB9CiAKICAgRlJBTUVfUklGIChmKS0+ZHJhd193aW5kb3dfY3Vyc29yICh3LCBn bHlwaF9yb3csIHgsIHksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbmV3 X2N1cnNvcl90eXBlLCBuZXdfY3Vyc29yX3dpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIG9uLCBhY3RpdmVfY3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VlOwogICAgICAg ZWxzZSBpZiAoQ09OU1AgKHZhbHVlKSkKLSAgICAgICAgewotICAgICAgICAgIExpc3BfT2JqZWN0 IGtleSwgdmFsLCBsaXN0OwotCi0gICAgICAgICAgbGlzdCA9IHZhbHVlOwotICAgICAgICAgIC8q IEZJWE1FPyAgVGhpcyBlcnJzIG9uIHRoZSBzaWRlIG9mIGFjY2VwdGFuY2UuICBFZyBpdCBhY2Nl cHRzOgotICAgICAgICAgICAgICAgKGRlZmZhY2UgZm9vICcoKHQgOnVuZGVybGluZSAnZm9vKSAi ZG9jIikKLSAgICAgICAgICAgICBNYXliZSB0aGlzIGlzIGludGVudGlvbmFsLCBtYXliZSBpdCBp c24ndC4KLSAgICAgICAgICAgICBOb24tbmlsIHN5bWJvbHMgb3RoZXIgdGhhbiB0IGFyZSBub3Qg ZG9jdW1lbnRlZCBhcyBiZWluZyB2YWxpZC4KLSAgICAgICAgICAgICBFZyBjb21wYXJlIHdpdGgg aW52ZXJzZS12aWRlbywgd2hpY2ggZXhwbGljaXRseSByZWplY3RzIHRoZW0uCi0gICAgICAgICAg Ki8KLSAgICAgICAgICB2YWxpZF9wID0gdHJ1ZTsKLQotICAgICAgICAgIHdoaWxlICghTklMUCAo Q0FSX1NBRkUobGlzdCkpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBrZXkgPSBDQVJf U0FGRSAobGlzdCk7Ci0gICAgICAgICAgICAgIGxpc3QgPSBDRFJfU0FGRSAobGlzdCk7Ci0gICAg ICAgICAgICAgIHZhbCA9IENBUl9TQUZFIChsaXN0KTsKLSAgICAgICAgICAgICAgbGlzdCA9IENE Ul9TQUZFIChsaXN0KTsKLQotICAgICAgICAgICAgICBpZiAoTklMUCAoa2V5KSB8fCBOSUxQICh2 YWwpKQotICAgICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAgIHZhbGlkX3AgPSBmYWxz ZTsKLSAgICAgICAgICAgICAgICAgIGJyZWFrOwotICAgICAgICAgICAgICAgIH0KLQotICAgICAg ICAgICAgICBlbHNlIGlmIChFUSAoa2V5LCBRQ2NvbG9yKQotICAgICAgICAgICAgICAgICAgICAg ICAmJiAhKEVRICh2YWwsIFFmb3JlZ3JvdW5kX2NvbG9yKQotICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHx8IChTVFJJTkdQICh2YWwpICYmIFNDSEFSUyAodmFsKSA+IDApKSkKLSAgICAgICAg ICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICB2YWxpZF9wID0gZmFsc2U7Ci0gICAgICAgICAg ICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0KLSAgICAgICAgICAgICAgZWxzZSBp ZiAoRVEgKGtleSwgUUNzdHlsZSkKLSAgICAgICAgICAgICAgICAgICAgICAgJiYgIShFUSAodmFs LCBRbGluZSkgfHwgRVEgKHZhbCwgUXdhdmUpKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICB2YWxpZF9wID0gZmFsc2U7Ci0gICAgICAgICAgICAgICAgICBicmVhazsKLSAg ICAgICAgICAgICAgICB9Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJICBMaXNwX09i amVjdCBrZXksIHZhbCwgbGlzdDsKKworCSAgbGlzdCA9IHZhbHVlOworCSAgLyogRklYTUU/ICBU aGlzIGVycnMgb24gdGhlIHNpZGUgb2YgYWNjZXB0YW5jZS4gIEVnIGl0IGFjY2VwdHM6CisJICAg ICAgIChkZWZmYWNlIGZvbyAnKCh0IDp1bmRlcmxpbmUgJ2ZvbykgImRvYyIpCisJICAgICBNYXli ZSB0aGlzIGlzIGludGVudGlvbmFsLCBtYXliZSBpdCBpc24ndC4KKwkgICAgIE5vbi1uaWwgc3lt Ym9scyBvdGhlciB0aGFuIHQgYXJlIG5vdCBkb2N1bWVudGVkIGFzIGJlaW5nIHZhbGlkLgorCSAg ICAgRWcgY29tcGFyZSB3aXRoIGludmVyc2UtdmlkZW8sIHdoaWNoIGV4cGxpY2l0b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OREVYLCB2YWx1ZSk7CkBAIC0zMDI5LDI2ICszMDI5LDI2 IEBAIEZSQU1FIDAgbWVhbnMgY2hhbmdlIHRoZSBmYWNlIG9uIGFsbCBmcmFtZXMsIGFuZCBjaGFu Z2UgdGhlIGRlZmF1bHQKIAkgICAgICBlbHNlCiAJCWYxID0gWEZSQU1FIChmcmFtZSk7CiAKLSAg ICAgICAgICAgICAgLyogRklYTUU6Ci0gICAgICAgICAgICAgICAgIElmIGZyYW1lIGlzIHQsIGFu ZCBzZWxlY3RlZCBmcmFtZSBpcyBhIHR0eSBmcmFtZSwgdGhlIGZvbnQKLSAgICAgICAgICAgICAg ICAgY2FuJ3QgYmUgcmVhbGl6ZWQuICBBbiBpbXByb3ZlbWVudCB3b3VsZCBiZSB0byBsb29wIG92 ZXIgZnJhbWVzCi0gICAgICAgICAgICAgICAgIGZvciBhIG5vbi10dHkgZnJhbWUgYW5kIHVzZSB0 aGF0LiAgU2VlIGRpc2N1c3Npb24gaW4gQnVnIzE4NTczLgotICAgICAgICAgICAgICAgICBGb3Ig YSBkYWVtb24sIGZyYW1lIG1heSBiZSBhbiBpbml0aWFsIGZyYW1lIChCdWcjMTg4NjkpLiAgKi8K LSAgICAgICAgICAgICAgaWYgKEZSQU1FX1dJTkRPV19QIChmMSkpCi0gICAgICAgICAgICAgICAg ewotICAgICAgICAgICAgICAgICAgaWYgKCEgRk9OVF9PQkpFQ1RfUCAodmFsdWUpKQotICAgICAg ICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgKmF0dHJz ID0gWFZFQ1RPUiAobGZhY2UpLT5jb250ZW50czsKLSAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCBmb250X29iamVjdDsKLQotICAgICAgICAgICAgICAgICAgICAgIGZvbnRfb2JqZWN0 ID0gZm9udF9sb2FkX2Zvcl9sZmFjZSAoZjEsIGF0dHJzLCB2YWx1ZSk7Ci0gICAgICAgICAgICAg ICAgICAg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ZXRfbGlzcF9mYWNl X2F0dHJpYnV0ZS4gICovCiAgICAgICB3aGlsZSAoQ09OU1AgKHVuZGVybGluZSkpCi0gICAgICAg IHsKLSAgICAgICAgICBMaXNwX09iamVjdCBrZXl3b3JkLCB2YWx1ZTsKLQotICAgICAgICAgIGtl eXdvcmQgPSBYQ0FSICh1bmRlcmxpbmUpOwotICAgICAgICAgIHVuZGVybGluZSA9IFhDRFIgKHVu ZGVybGluZSk7Ci0KLSAgICAgICAgICBpZiAoIUNPTlNQICh1bmRlcmxpbmUpKQotICAgICAgICAg ICAgYnJlYWs7Ci0gICAgICAgICAgdmFsdWUgPSBYQ0FSICh1bmRlcmxpbmUpOwotICAgICAgICAg IHVuZGVybGluZSA9IFhDRFIgKHVuZGVybGluZSk7Ci0KLSAgICAgICAgICBpZiAoRVEgKGtleXdv cmQsIFFDY29sb3IpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBpZiAoRVEgKHZhbHVl LCBRZm9yZWdyb3VuZF9jb2xvcikpCi0gICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAg ICAgZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wID0gdHJ1ZTsKLSAgICAgICAgICAgICAgICAg IGZhY2UtPnVuZGVybGluZV9jb2xvciA9IDA7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAg ICAgICBlbHNlIGlmIChTVFJJTkdQICh2YWx1ZSkpCi0gICAgICAgICAgICAgICAgewotICAgICAg ICAgICAgICAgICAgZmFjZS0+dW5kZXJsaW5lX2RlZmF1bHRlZF9wID0gZmFsc2U7Ci0gICAgICAg ICAgICAgICAgICBmYWNlLT51bmRlcmxpbmVfY29sb3IgPSBsb2FkX2NvbG9yIChmLCBmYWNlLCB2 YWx1ZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIExGQUNFX1VOREVSTElORV9JTkRFWCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAg ICAgfQotICAgICAgICAgIGVsc2UgaWYgKEVRIChrZXl3b3JkLCBRQ3N0eWxlKSkKLSAgICAgICAg ICAgIHsKLSAgICAgICAgICAgICAgaWYgKEVRICh2YWx1ZSwgUWxpbmUpKQotICAgICAgICAgICAg ICAgIGZhY2UtPnVuZGVybGluZV90eXBlID0gRkFDRV9VTkRFUl9MSU5FOwotICAgICAgICAgICAg ICBlbHNlIGlmIChFUSAodmFsdWUsIFF3YXZlKSkKLSAgICAgICAgICAgICAgICBmYWNlLT51bmRl cmxpbmVfdHlwZSA9IEZBQ0VfVU5ERVJfV0FWRTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQor CXsKKwkgIExpc3BfT2JqZWN0IGtleXdvcmQsIHZhbHVlOworCisJICBrZXl3b3JkID0gWENBUiAo dW5kZXJsaW5lKTsKKwkgIHVuZGVybGluZSA9IFhDRFIgKHVuZGVybGluZSk7CisKKwkgIGlmICgh Q09OU1AgKHVuZGVybGluZSkpCisJICAgIGJyZWFrOworCSAgdmFsdWUgPSBYQ0FSICh1bmRlcmxp bmUpOworCSAgdW5kZXJsaW5lID0gWENEUiAodW5kZXJsaW5lKTsKKworCSAgaWYgKEVRIChrZXl3 b3JkLCBRQ2NvbG9yKSkKKwkgICAgeworCSAgICAgIGlmIChFUSAodmFsdWUsIFFmb3JlZ3JvdW5k X2NvbG9yKSkKKwkJeworCQkgIGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCA9IHRydWU7CisJ CSAgZmFjZS0+dW5kZXJsaW5lX2NvbG9yID0gMDsKKwkJfQorCSAgICAgIGVsc2UgaWYgKFNUUklO R1AgKHZhbHVlKSkKKwkJeworCQkgIGZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCA9IGZhbHNl OworCQkgIGZhY2UtPnVuZGVybGluZV9jb2xvciA9IGxvYWRfY29sb3IgKGYsIGZhY2UsIHZhbHVl LAorCQkJCQkJICAgICAgTEZBQ0VfVU5ERVJMSU5FX0lOREV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dCBmcmFtZSAqZiwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCAqbGVmdF9v ZmZzZXRfeCwKLSAgICAgICAgICAgICAgICAgICAgICAgIGludCAqcmlnaHRfb2Zmc2V0X3gsCi0g ICAgICAgICAgICAgICAgICAgICAgICBpbnQgKnRvcF9vZmZzZXRfeSwKLSAgICAgICAgICAgICAg ICAgICAgICAgIGludCAqYm90dG9tX29mZnNldF95LAotICAgICAgICAgICAgICAgICAgICAgICAg aW50ICp4X3BpeGVsc19kaWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ICp5X3BpeGVs c19kaWZmLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ICp4cHRyLAotICAgICAgICAgICAg ICAgICAgICAgICAgaW50ICp5cHRyLAotICAgICAgICAgICAgICAgICAgICAgICAgaW50ICpvdXRl cl9ib3JkZXIpCisJCQlpbnQgKmxlZnRfb2Zmc2V0X3gsCisJCQlpbnQgKnJpZ2h0X29mZnNldF94 LAorCQkJaW50ICp0b3Bfb2Zmc2V0X3ksCisJCQlpbnQgKmJvdHRvbV9vZmZzZXRfeSwKKwkJCWlu dCAqeF9waXhlbHNfZGlmZiwKKwkJCWludCAqeV9waXhlbHNfZGlmZiwKKwkJCWludCAqeHB0ciwK KwkJCWludCAqeXB0ciwKKwkJCWludCAqb3V0ZXJfYm9yZGVyKQogewogICBpbnQgd2luX3ggPSAw LCB3aW5feSA9IDAsIG91dGVyX3ggPSAwLCBvdXRlcl95ID0gMDsKICAgaW50IHJlYWxfeCA9IDAs IHJlYWxfeSA9IDA7CkBAIC0yNzUsNyArMjc1LDcgQEAgeF9yZWFsX3Bvc19hbmRfb2Zmc2V0cyAo c3RydWN0IGZyYW1lICpmLAogI2VuZGlmCiAKICAgICAgIGlmIChoYWRfZXJyb3JzIHx8IHdtX3dp bmRvdyA9PSByb290dykKLSAgICAgICAgYnJlYWs7CisJYnJlYWs7CiAKICAgICAgIHdpbiA9IHdt X3dpbmRvdzsKICAgICB9C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2xhdGVfY29vcmRpbmF0 ZXMgKHhjYl9jb25uLAorCQkJCSAgIC8qIEZyb20td2luZG93LCB0by13aW5kb3cuICAqLworCQkJ CSAgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPnJvb3Rfd2luZG93LAorCQkJCSAgIEZSQU1FX1hf V0lORE9XIChmKSwKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9t LXBvc2l0aW9uLiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCk7 CisJCQkJICAgLyogRnJvbS1wb3NpdGlvbi4gICovCisJCQkJICAgMCwgMCk7CiAgICAgICBpZiAo RlJBTUVfWF9XSU5ET1cgKGYpICE9IEZSQU1FX09VVEVSX1dJTkRPVyAoZikpCi0gICAgICAgIG91 dGVyX3RyYW5zX2Nvb2tpZSA9Ci0gICAgICAgICAgeGNiX3RyYW5zbGF0ZV9jb29yZGluYXRlcyAo eGNiX2Nvbm4sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbS13 aW5kb3csIHRvLXdpbmRvdy4gICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgRlJBTUVfRElTUExBWV9JTkZPIChmKS0+cm9vdF93aW5kb3csCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgRlJBTUVfT1VURVJfV0lORE9XIChmKSwKLQotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZyb20tcG9zaXRpb24uICAqLwotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDApOworCW91dGVyX3RyYW5zX2Nvb2tp ZSA9CisJICB4Y2JfdHJhbnNsYXRlX2Nvb3JkaW5hdGVzICh4Y2JfY29ubiwKKwkJCQkgICAgIC8q IEZyb20td2luZG93LCB0by13aW5kb3cuICAqLworCQkJCSAgICAgRlJBTUVfRElTUExBWV9JTkZP IChmKS0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FhDQiBjYXNlLiAgKi8KICNpZmRlZiBVU0VfWENC CiAgICAgICB0cmFucyA9IHhjYl90cmFuc2xhdGVfY29vcmRpbmF0ZXNfcmVwbHkgKHhjYl9jb25u LCB0cmFuc19jb29raWUsIE5VTEwpOwogICAgICAgaWYgKHRyYW5zKQpAQCAtMzgxLDEwICszODEs MTAgQEAgeF9yZWFsX3Bvc19hbmRfb2Zmc2V0cyAoc3RydWN0IGZyYW1lICpmLAogCiAJCQkgICAg IC8qIEZyb20td2luZG93LCB0by13aW5kb3cuICAqLwogCQkJICAgICBGUkFNRV9ESVNQTEFZX0lO Rk8gKGYpLT5yb290X3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVf WF9XSU5ET1cgKGYpLAorCQkJICAgICBGUkFNRV9YX1dJTkRPVyAoZiksCiAKIAkJCSAgICAgLyog RnJvbS1wb3NpdGlvbiwgdG8tcG9zaXRpb24uICAqLwotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAwLCAwLCAmd2luX3gsICZ3aW5feSwKKwkJCSAgICAgMCwgMCwgJndpbl94LCAmd2luX3ks CiAKIAkJCSAgICAgLyogQ2hpbGQgb2Ygd2luLiAgKi8KIAkJCSAgICAgJmNoaWxkKTsKQEAgLTM5 NSwzNyArMzk1LDM3IEBAIHhfcmVhbF9wb3NfYW5kX29mZnNldHMgKHN0cnVjdCBmcmFtZSAqZiwK IAogICAgICAgaWYgKEZSQU1FX1hfV0lORE9XIChmKSA9PSBGUkFNRV9PVVRFUl9XSU5ET1cgKGYp KQogCXsKLSAgICAgICAgICBvdXRlcl94ID0gd2luX3g7Ci0gICAgICAgICAgb3V0ZXJfeSA9IHdp bl95OworCSAgb3V0ZXJfeCA9IHdpbl94OworCSAgb3V0ZXJfeSA9IHdpbl95OwogCX0KICAgICAg IGVsc2UKLSAgICAgICAgeworCXsKICNpZmRlZiBVU0VfWENCCi0gICAgICAgICAgeGNiX3RyYW5z bGF0ZV9jb29yZGluYXRlc19yZXBseV90ICpvdXRlcl90cmFuczsKLQotICAgICAgICAgIG91dGVy X3RyYW5zID0geGNiX3RyYW5zbGF0ZV9jb29yZGluYXRlc19yZXBseSAoeGNiX2Nvbm4sCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBvdXRl cl90cmFuc19jb29raWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICBOVUxMKTsKLSAgICAgICAgICBpZiAob3V0ZXJfdHJhbnMpCi0gICAg ICAgICAgICB7Ci0gICAgICAgICAgICAgIG91dGVyX3ggPSBvdXRlcl90cmFucy0+ZHN0X3g7Ci0g ICAgICAgICAgICAgIG91dGVyX3kgPSBvdXRlcl90cmFucy0+ZHN0X3k7Ci0gICAgICAgICAgICAg IGZyZWUgKG91dGVyX3RyYW5zKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgICBlbHNlCisJICB4 Y2JfdHJhbnNsYXRlX2Nvb3JkaW5hdGVzX3JlcGx5X3QgKm91dGVyX3RyYW5zOworCisJICBvdXRl cl90cmFucyA9IHhjYl90cmFuc2xhdGVfY29vcmRpbmF0ZXNfcmVwbHkgKHhjYl9jb25uLAorCQkJ CQkJCSBvdXRlcl90cmFuc19jb29raWUsCisJCQkJCQkJIE5VTEwpOworCSAgaWYgKG91dGVyX3Ry YW5zKQorCSAgICB7CisJICAgICAgb3V0ZXJfeCA9IG91dGVyX3RyYW5zLT5kc3RfeDsKKwkgICAg ICBvdXRlcl95ID0gb3V0ZXJfdHJhbnMtPmRzdF95OworCSAgICAgIGZyZWUgKG91dGVyX3RyYW5z KTsKKwkgICAgfQorCSAgZWxzZQogCSAgICBoYWRfZXJyb3JzID0gdHJ1ZTsKICNlbHNlCi0gICAg ICAgICAgWFRyYW5zbGF0ZUNvb3JkaW5hdGVzIChkcHksCisJICBYVHJhbnNsYXRlQ29vcmRpbmF0 ZXMgKGRweSwKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbS13aW5k b3csIHRvLXdpbmRvdy4gICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFN RV9ESVNQTEFZX0lORk8gKGYpLT5yb290X3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIEZSQU1FX09VVEVSX1dJTkRPVyAoZiksCisJCQkJIC8qIEZyb20td2luZG93LCB0 by13aW5kb3cuICAqLworCQkJCSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpLT5yb290X3dpbmRvdywK KwkJCQkgRlJBTUVfT1VURVJfV0lORE9XIChmKSwKIAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgLyogRnJvbS1wb3NpdGlvbiwgdG8tcG9zaXRpb24uICAqLwotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgMCwgMCwgJm91dGVyX3gsICZvdXRlcl95LAorCQkJCSAvKiBG cm9tLXBvc2l0aW9uLCB0by1wb3NpdGlvbi4gICovCisJCQkJIDAsIDAsICZvdXRlcl94LCAmb3V0 ZXJfeSwKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogQ2hpbGQgb2Ygd2lu LiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZjaGlsZCk7CisJCQkJIC8q IENoaWxkIG9mIHdpbi4gICovCisJCQkJICZjaGlsZCk7CiAjZW5kaWYKIAogCSAgb3V0ZXJfeCAr PSByZWFsX3g7CkBAIC00NDIsNDYgKzQ0Miw0NiBAQCB4X3JlYWxfcG9zX2FuZF9vZmZzZXRzIChz dHJ1Y3QgZnJhbWUgKmYsCiAgICAgICAvKiBUcnkgX05FVF9GUkFNRV9FWFRFTlRTIGlmIG91ciBw YXJlbnQgaXMgdGhlIHJvb3Qgd2luZG93LiAgKi8KICNpZmRlZiBVU0VfWENCCiAgICAgICAvKiBN YWtlIHN1cmUgd2UgZGlkbid0IGdldCBhbiBYIGVycm9yIGVhcmx5IGFuZCBza2lwIHNlbmRpbmcg dGhlCi0gICAgICAgICByZXF1ZXN0LiAgKi8KKwkgcmVxdWVzdC4gICovCiAgICAgICBpZiAoc2Vu dF9yZXF1ZXN0cykKLSAgICAgICAgewotICAgICAgICAgIHhjYl9nZXRfcHJvcGVydHlfcmVwbHlf dCAqcHJvcDsKLQotICAgICAgICAgIHByb3AgPSB4Y2JfZ2V0X3Byb3BlcnR5X3JlcGx5ICh4Y2Jf Y29ubiwgcHJvcF9jb29raWUsIE5VTEwpOwotICAgICAgICAgIGlmIChwcm9wKQotICAgICAgICAg ICAgewotICAgICAgICAgICAgICBpZiAocHJvcC0+dHlwZSA9PSB0YXJnZXRfdHlwZQotICAgICAg ICAgICAgICAgICAgJiYgcHJvcC0+Zm9ybWF0ID09IDMyCi0gICAgICAgICAgICAgICAgICAmJiAo eGNiX2dldF9wcm9wZXJ0eV92YWx1ZV9sZW5ndGggKHByb3ApCisJeworCSAgeGNiX2dldF9wcm9w ZXJ0eV9yZXBseV90ICpwcm9wOworCisJICBwcm9wID0geGNiX2dldF9wcm9wZXJ0eV9yZXBseSAo eGNiX2Nvbm4sIHByb3BfY29va2llLCBOVUxMKTsKKwkgIGlmIChwcm9wKQorCSAgICB7CisJICAg ICAgaWYgKHByb3AtPnR5cGUgPT0gdGFyZ2V0X3R5cGUKKwkJICAmJiBwcm9wLT5mb3JtYXQgPT0g MzIKKwkJICAmJiAoeGNiX2dldF9wcm9wZXJ0eV92YWx1ZV9sZW5ndGggKHByb3ApCiAJCSAgICAg ID09IDQgKiBzaXplb2YgKGludDMyX3QpKSkKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgICAgICBpbnQzMl90ICpmZSA9IHhjYl9nZXRfcHJvcGVydHlfdmFsdWUgKHByb3ApOwotCi0g ICAgICAgICAgICAgICAgICBvdXRlcl94ID0gLWZlWzBdOwotICAgICAgICAgICAgICAgICAgb3V0 ZXJfeSA9IC1mZVsyXTsKLSAgICAgICAgICAgICAgICAgIHJlYWxfeCAtPSBmZVswXTsKLSAgICAg ICAgICAgICAgICAgIHJlYWxfeSAtPSBmZVsyXTsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAg ICAgICAgIGZyZWUgKHByb3ApOwotICAgICAgICAgICAgfQotICAgICAgICAgIC8qIFhsaWIgdmVy c2lvbiBkb2Vzbid0IHNldCBoYWRfZXJyb3JzIGhlcmUuICBJbnRlbnRpb25hbCBvciBidWc/ICAq LwotICAgICAgICB9CisJCXsKKwkJICBpbnQzMl90ICpmZSA9IHhjYl9nZXRfcHJvcGVydHlfdmFs dWUgKHByb3ApOworCisJCSAgb3V0ZXJfeCA9IC1mZVswXTsKKwkJICBvdXRlcl95ID0gLWZlWzJd OworCQkgIHJlYWxfeCAtPSBmZVswXTsKKwkJICByZWFsX3kgLT0gZmVbMl07CisJCX0KKwkgICAg ICBmcmVlIChwcm9wKTsKKwkgICAgfQorCSAgLyogWGxpYiB2ZXJzaW9uIGRvZXNuJ3Qgc2V0IGhh ZF9lcnJvcnMgaGVyZS4gIEludGVudGlvbmFsIG9yIGJ1Zz8gICovCisJfQogI2Vsc2UKICAgICAg IHJjID0gWEdldFdpbmRvd1Byb3BlcnR5IChkcHksIHdpbiwgZHB5aW5mby0+WGF0b21fbmV0X2Zy YW1lX2V4dGVudHMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgbWF4X2xlbiwg RmFsc2UsIHRhcmdldF90eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZhY3R1 YWxfdHlwZSwgJmFjdHVhbF9mb3JtYXQsICZhY3R1YWxfc2l6ZSwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAmYnl0ZXNfcmVtYWluaW5nLCAmdG1wX2RhdGEpOworCQkJICAgICAgIDAs IG1heF9sZW4sIEZhbHNlLCB0YXJnZXRfdHlwZSwKKwkJCSAgICAgICAmYWN0dWFsX3R5cGUsICZh Y3R1YW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0cykKLSAgICAgICAgewotICAgICAgICAgIHhj Yl9nZXRfZ2VvbWV0cnlfcmVwbHlfdCAqb3V0ZXJfZ2VvbTsKLQotICAgICAgICAgIG91dGVyX2dl b20gPSB4Y2JfZ2V0X2dlb21ldHJ5X3JlcGx5ICh4Y2JfY29ubiwgb3V0ZXJfZ2VvbV9jb29raWUs Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwpOwot ICAgICAgICAgIGlmIChvdXRlcl9nZW9tKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBm dyA9IG91dGVyX2dlb20tPndpZHRoOwotICAgICAgICAgICAgICBmaCA9IG91dGVyX2dlb20tPmhl aWdodDsKLSAgICAgICAgICAgICAgZnJlZSAob3V0ZXJfZ2VvbSk7Ci0gICAgICAgICAgICB9Ci0g ICAgICAgICAgZWxzZQorCXsKKwkgIHhjYl9nZXRfZ2VvbWV0cnlfcmVwbHlfdCAqb3V0ZXJfZ2Vv bTsKKworCSAgb3V0ZXJfZ2VvbSA9IHhjYl9nZXRfZ2VvbWV0cnlfcmVwbHkgKHhjYl9jb25uLCBv dXRlcl9nZW9tX2Nvb2tpZSwKKwkJCQkJICAgICAgIE5VTEwpOworCSAgaWYgKG91dGVyX2dlb20p CisJICAgIHsKKwkgICAgICBmdyA9IG91dGVyX2dlb20tPndpZHRoOworCSAgICAgIGZoID0gb3V0 ZXJfZ2VvbS0+aGVpZ2h0OworCSAgICAgIGZyZWUgKG91dGVyX2dlb20pOworCSAgICB9CisJICBl bHNlCiAJICAgIGhhZF9lcnJvcnMgPSB0cnVlOwotICAgICAgICB9CisJfQogI2Vsc2UKICAgICAg IGludCB4eV9pZ247CiAgICAgICB1bnNpZ25lZCBpbnQgaWduOwpAQCAtNTQ4LDcgKzU0OCw3IEBA IHZvaWQKIHhfcmVhbF9wb3NpdGlvbnMgKHN0cnVjdCBmcmFtZSAqZiwgaW50ICp4cHRyLCBpbnQg KnlwdHIpCiB7CiAgIHhfcmVhbF9wb3NfYW5kX29mZnNldHMgKGYsIE5VTEwsIE5VTEwsIE5VTEws IE5VTEwsIE5VTEwsIE5VTEwsIHhwdHIsIHlwdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAg IE5VTEwpOworCQkJICBOVUxMKTsKIH0KIAogCkBAIC01NjUsMzUgKzU2NSwzNSBAQCB4X3JlbGF0 aXZlX21vdXNlX3Bvc2l0aW9uIChzdHJ1Y3QgZnJhbWUgKmYsIGludCAqeCwgaW50ICp5KQogICBi bG9ja19pbnB1dCAoKTsKIAogICBYUXVlcnlQb2ludGVyIChGUkFNRV9YX0RJU1BMQVkgKGYpLAot ICAgICAgICAgICAgICAgICBEZWZhdWx0Um9vdFdpbmRvdyAoRlJBTUVfWF9ESVNQTEFZIChmKSks CisJCSBEZWZhdWx0Um9vdFdpbmRvdyAoRlJBTUVfWF9ESVNQTEFZIChmKSksCiAKLSAgICAgICAg ICAgICAgICAgLyogVGhlIHJvb3Qgd2luZG93IHdoaWNoIGNvbnRhaW5zIHRoZSBwb2ludGVyLiAg Ki8KLSAgICAgICAgICAgICAgICAgJnJvb3QsCisJCSAvKiBUaGUgcm9vdCB3aW5kb3cgd2hpY2gg Y29udGFpbnMgdGhlIHBvaW50ZXIuICAqLworCQkgJnJvb3QsCiAKLSAgICAgICAgICAgICAgICAg LyogV2luZG93IHBvaW50ZXIgaXMgb24sIG5vdCB1c2VkICAqLwotICAgICAgICAgICAgICAgICAm ZHVtbXlfd2luZG93LAorCQkgLyogV2luZG93IHBvaW50ZXIgaXMgb24sIG5vdCB1c2VkICAqLwor CQkgJmR1bW15X3dpbmRvdywKIAotICAgICAgICAgICAgICAgICAvKiBUaGUgcG9zaXRpb24gb24g dGhhdCByb290IHdpbmRvdy4gICovCi0gICAgICAgICAgICAgICAgIHgsIHksCisJCSAvKiBUaGUg cG9zaXRpb24gb24gdGhhdCByb290IHdpbmRvdy4gICovCisJCSB4LCB5LAogCi0gICAgICAgICAg ICAgICAgIC8qIHgveSBpbiBkdW1teV93aW5kb3cgY29vcmRpbmF0ZXMsIG5vdCB1c2VkLiAgKi8K LSAgICAgICAgICAgICAgICAgJmR1bW15LCAmZHVtbXksCisJCSAvKiB4L3kgaW4gZHVtbXlfd2lu ZG93IGNvb3JkaW5hdGVzLCBub3QgdXNlZC4gICovCisJCSAmZHVtbXksICZkdW1teSwKIAotICAg ICAgICAgICAgICAgICAvKiBNb2RpZmllciBrZXlzIGFuZCBwb2ludGVyIGJ1dHRvbnMsIGFib3V0 IHdoaWNoCi0gICAgICAgICAgICAgICAgICAgIHdlIGRvbid0IGNhcmUuICAqLwotICAgICAgICAg ICAgICAgICAodW5zaWduZWQgaW50ICopICZkdW1teSk7CisJCSAvKiBNb2RpZmllciBrZXlzIGFu ZCBwb2ludGVyIGJ1dHRvbnMsIGFib3V0IHdoaWNoCisJCSAgICB3ZSBkb24ndCBjYXJlLiAgKi8K KwkJICh1bnNpZ25lZCBpbnQgKikgJmR1bW15KTsKIAogICBYVHJhbnNsYXRlQ29vcmRpbmF0ZXMg KEZSQU1FX1hfRElTUExBWSAoZiksCiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAvKiBGcm9t LXdpbmRvdywgdG8td2luZG93LiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9E SVNQTEFZX0lORk8gKGYpLT5yb290X3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAgICBG UkFNRV9YX1dJTkRPVyAoZiksCisJCQkgLyogRnJvbS13aW5kb3csIHRvLXdpbmRvdy4gICovCisJ CQkgRlJBTUVfRElTUExBWV9JTkZPIChmKS0+cm9vdF93aW5kb3csCisJCQkgRlJBTUVfWF9XSU5E T1cgKGYpLAogCi0gICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJvbS1wb3NpdGlvbiwgdG8t cG9zaXRpb24uICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICp4LCAqeSwgeCwgeSwKKwkJ CSAvKiBGcm9tLXBvc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g RlJBTUVfWElDX0ZPTlRTRVQgKGNmKTsKLSAgICAgICAgICBicmVhazsKLSAgICAgICAgfQorCXsK KwkgIHhmcyA9IEZSQU1FX1hJQ19GT05UU0VUIChjZik7CisJICBicmVhazsKKwl9CiAgICAgfQog CiAgIGlmICghIHhmcykKQEAgLTIyNTksMTIgKzIyNTksMTIgQEAgeGljX2ZyZWVfeGZvbnRzZXQg KHN0cnVjdCBmcmFtZSAqZikKICAgICB7CiAgICAgICBzdHJ1Y3QgZnJhbWUgKmNmID0gWEZSQU1F IChmcmFtZSk7CiAgICAgICBpZiAoY2YgIT0gZiAmJiBGUkFNRV9MSVZFX1AgKGYpICYmIEZSQU1F X1hfUCAoY2YpCi0gICAgICAgICAgJiYgRlJBTUVfRElTUExBWV9JTkZPIChjZikgPT0gRlJBTUVf RElTUExBWV9JTkZPIChmKQotICAgICAgICAgICYmIEZSQU1FX1hJQ19GT05UU0VUIChjZikgPT0g RlJBTUVfWElDX0ZPTlRTRVQgKGYpKQotICAgICAgICB7Ci0gICAgICAgICAgc2hhcmVkX3AgPSB0 cnVlOwotICAgICAgICAgIGJyZWFrOwotICAgICAgICB9CisJICAmJiBGUkFNRV9ESVNQTEFZX0lO Rk8gKGNmKSA9PSBGUkFNRV9ESVNQTEFZX0lORk8gKGYpCisJICAmJiBGUkFNRV9YSUNfRk9OVFNF VCAoY2YpID09IEZSQU1FX1hJQ19GT05UU0VUIChmKSkKKwl7CisJICBzaGFyZWRfcCA9IHRydWU7 CisJICBicmVhazsKKwl9CiAgICAgfQogCiAgIGlmICghc2hhcmVkX3ApCkBAIC0yMzIzLDcgKzIz MjMsNyBAQCBjcmVhdGVfZnJhbWVfeGljIChzdHJ1Y3QgZnJhbWUgKmYpCiAgICAgewogICAgICAg eGZzID0geGljX2NyZWF0ZV94Zm9udHNldCAoZik7CiAgICAgICBpZiAoIXhmcykKLSAgICAgICAg Z290byBvdXQ7CisJZ290byBvdXQ7CiAKICAgICAgIEZSQU1FX1hJQ19GT05UU0VUIChmKSA9IHhm czsKICAgICB9CkBAIC0yMzQ0LDU1ICsyMzQ0LDU1IEBAIGNyZWF0ZV9mcmFtZV94aWMgKHN0cnVj dCBmcmFtZSAqZikKIAkJCQkJICBOVUxMKTsKIAogICAgICAgaWYgKCFwcmVlZGl0X2F0dHIpCi0g ICAgICAgIGdvdG8gb3V0OworCWdvdG8gb3V0OwogICAgIH0KIAogICBpZiAoeGljX3N0eWxlICYg WElNU3RhdHVzQXJlYSkKICAgICB7CiAgICAgICBzX2FyZWEueCA9IDA7IHNfYXJlYS55ID0gMDsg c19hcmVhLndpZHRoID0gMTsgc19hcmVhLmhlaWdodCA9IDE7CiAgICAgICBzdGF0dXNfYXR0ciA9 IFhWYUNyZWF0ZU5lc3RlZExpc3QgKDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIFhOQXJlYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJnNfYXJlYSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgWE5G b250U2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4ZnMsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhORm9yZWdyb3VuZCwKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVfRk9SRUdST1VORF9Q SVhFTCAoZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhOQmFj a2dyb3VuZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVf QkFDS0dST1VORF9QSVhFTCAoZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgIE5VTEwpOworCQkJCQkgWE5BcmVhLAorCQkJCQkgJnNfYXJlYSwKKwkJCQkJIFhORm9u dFNldCwKKwkJCQkJIHhmcyw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gICAg ICAgICAgICAgICAgICAgIFhOSW5wdXRTdHlsZSwgeGljX3N0eWxlLAotICAgICAgICAgICAgICAg ICAgICAgWE5DbGllbnRXaW5kb3csIEZSQU1FX1hfV0lORE9XIChmKSwKLSAgICAgICAgICAgICAg ICAgICAgIFhORm9jdXNXaW5kb3csIEZSQU1FX1hfV0lORE9XIChmKSwKLSAgICAgICAgICAgICAg ICAgICAgIFhOUHJlZWRpdEF0dHJpYnV0ZXMsIHByZWVkaXRfYXR0ciwKLSAgICAgICAgICAgICAg ICAgICAgIE5VTEwpOworCQkgICAgIFhOSW5wdXRTdHlsZSwgeGljX3N0eWxlLAorCQkgICAgIFhO Q2xpZW50V2luZG93LCBGUkFNRV9YX1dJTkRPVyAoZiksCisJCSAgICAgWE5Gb2N1c1dpbmRvdywg RlJBTUVfWF9XSU5ET1cgKGYpLAorCQkgICAgIFhOUHJlZWRpdEF0dHJpYnV0ZXMsIHByZWVkaXRf YXR0ciwKKwkJICAgICBOVUxMKTsKICAgZWxzZSBpZiAoc3RhdHVzX2F0dHIpCiAgICAgeGljID0g WENyZWF0ZUlDICh4aW0sCi0gICAgICAgICAgICAgICAgICAgICBYTklucHV0U3R5bGUsIHhpY19z dHlsZSwKLSAgICAgICAgICAgICAgICAgICAgIFhOQ2xpZW50V2luZG93LCBGUkFNRV9YX1dJTkRP VyAoZiksCi0gICAgICAgICAgICAgICAgICAgICBYTkZvY3VzV2luZG93LCBGUkFNRV9YX1dJTkRP VyAoZiksCi0gICAgICAgICAgICAgICAgICAgICBYTlN0YXR1c0F0dHJpYnV0ZXMsIHN0YXR1c19h dHRyLAotICAgICAgICAgICAgICAgICAgICAgTlVMTCk7CisJCSAgICAgWE5JbnB1dFN0eWxlLCB4 aWNfc3R5bGUsCisJCSAgICAgWE5DbGllbnRXaW5kb3csIEZSQU1FX1hfV0lORE9XIChmKSwKKwkJ ICAgICBYTkZvY3VzV2luZG93LCBGUkFNRV9YX1dJTkRPVyAoZiksCisJCSAgICAgWE5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0gICAgICAgICAgZWxzZSBpZiAoZnJlY3QueCA+IG1pLT5nZW9tLnggKyBtaS0+Z2VvbS53aWR0 aCkKLSAgICAgICAgICAgIGR4ID0gZnJlY3QueCAtIG1pLT5nZW9tLnggKyBtaS0+Z2VvbS53aWR0 aDsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICBkeCA9IDA7Ci0gICAgICAgICAgaWYgKGZy ZWN0LnkgKyBmcmVjdC5oZWlnaHQgPCBtaS0+Z2VvbS55KQotICAgICAgICAgICAgZHkgPSBtaS0+ Z2VvbS55IC0gZnJlY3QueSArIGZyZWN0LmhlaWdodDsKLSAgICAgICAgICBlbHNlIGlmIChmcmVj dC55ID4gbWktPmdlb20ueSArIG1pLT5nZW9tLmhlaWdodCkKLSAgICAgICAgICAgIGR5ID0gZnJl Y3QueSAtIG1pLT5nZW9tLnkgKyBtaS0+Z2VvbS5oZWlnaHQ7Ci0gICAgICAgICAgZWxzZQotICAg ICAgICAgICAgZHkgPSAwOwotCi0gICAgICAgICAgZCA9IGR4KmR4ICsgZHkqZHk7Ci0gICAgICAg ICAgaWYgKGRpc3QgPT0gLTEgfHwgZGlzdCA+IGQpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAg ICAgIGRpc3QgPSBkOwotICAgICAgICAgICAgICBiZXN0X2Rpc3QgPSBpOwotICAgICAgICAgICAg fQotICAgICAgICB9CisJeworCSAgaW50IGR4LCBkeSwgZDsKKwkgIGlmIChmcmVjdC54ICsgZnJl Y3Qud2lkdGggPCBtaS0+Z2VvbS54KQorCSAgICBkeCA9IG1pLT5nZW9tLnggLSBmcmVjdC54ICsg ZnJlY3Qud2lkdGg7CisJICBlbHNlIGlmIChmcmVjdC54ID4gbWktPmdlb20ueCArIG1pLT5nZW9t LndpZHRoKQorCSAgICBkeCA9IGZyZWN0LnggLSBtaS0+Z2VvbS54ICsgbWktPmdlb20ud2lkdGg7 CisJICBlbHNlCisJICAgIGR4ID0gMDsKKwkgIGlmIChmcmVjdC55ICsgZnJlY3QuaGVpZ2h0IDwg bWktPmdlb20ueSkKKwkgICAgZHkgPSBtaS0+Z2VvbS55IC0gZnJlY3QueSArIGZyZWN0LmhlaWdo dDsKKwkgIGVsc2UgaWYgKGZyZWN0LnkgPiBtaS0+Z2VvbS55ICsgbWktPmdlb20uaGVpZ2h0KQor CSAgICBkeSA9IGZyZWN0LnkgLSBtaS0+Z2VvbS55ICsgbWktPmdlb20uaGVpZ2h0OworCSAgZWxz ZQorCSAgICBkeSA9IDA7CisKKwkgIGQgPSBkeCpkeCArIGR5KmR5OworCSAgaWYgKGRpc3QgPT0g LTEgfHwgZGlzdCA+IGQpCisJICAgIHsKKwkgICAgICBkaXN0ID0gZDsKKwkgICAgICBiZXN0X2Rp c3QgPSBpOworCSAgICB9CisJfQogICAgIH0KIAogICByZXR1cm4gYmVzdF9hcmVhICE9IC0xID8g YmVzdF9hcmVhIDogKGJlc3RfZGlzdCAhPSAtMSA/IGJlc3RfZGlzdCA6IDApOwpAQCAtNDI0Mywx MCArNDI0MywxMCBAQCB4X2dldF9tb25pdG9yX2Zvcl9mcmFtZSAoc3RydWN0IGZyYW1lICpmLAog CiBzdGF0aWMgTGlzcF9PYmplY3QKIHhfbWFrZV9tb25pdG9yX2F0dHJpYnV0ZV9saXN0IChzdHJ1 Y3QgTW9uaXRvckluZm8gKm1vbml0b3JzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IGludCBuX21vbml0b3JzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCBwcmlt YXJ5X21vbml0b3IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgc3RydWN0IHhfZGlz cGxheV9pbmZvICpkcHlpbmZvLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvbnN0 IGNoYXIgKnNvdXJjZSkKKwkJCSAgICAgICBpbnQgbl9tb25pdG9ycywKKwkJCSAgICAgICBpbnQg cHJpbWFyeV9tb25pdG9yLAorCQkJICAgICAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5m bywKKwkJCSAgICAgICBjb25zdCBjaGFyICpzb3VyY2UpCiB7CiAgIExpc3BfT2JqZWN0IG1vbml0 b3JfZnJhbWVzID0gRm1ha2VfdmVjdG9yIChtYWtlX251bWJlciAobl9tb25pdG9ycyksIFFuaWwp OwogICBMaXNwX09iamVjdCBmcmFtZSwgcmVzdDsKQEAgLTQyNjQsNyArNDI2NCw3IEBAIHhfbWFr ZV9tb25pdG9yX2F0dHJpYnV0ZV9saXN0IChzdHJ1Y3QgTW9uaXRvckluZm8gKm1vbml0b3JzLAog ICAgIH0KIAogICByZXR1cm4gbWFrZV9tb25pdG9yX2F0dHJpYnV0ZV9saXN0IChtb25pdG9ycywg bl9tb25pdG9ycywgcHJpbWFyeV9tb25pdG9yLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBtb25pdG9yX2ZyYW1lcywgc291cmNlKTsKKwkJCQkgICAgICBtb25pdG9yX2Zy YW1lcywgc291cmNlKTsKIH0KIAogc3RhdGljIExpc3BfT2JqZWN0CkBAIC00MzQwLDEwICs0MzQw LDEwIEBAIHhfZ2V0X21vbml0b3JfYXR0cmlidXRlc194aW5lcmFtYSAoc3RydWN0IHhfZGlzcGxh eV9pbmZvICpkcHlpbmZvKQogICBYRnJlZSAoaW5mbyk7CiAKICAgYXR0cmlidXRlc19saXN0ID0g eF9tYWtlX21vbml0b3JfYXR0cmlidXRlX2xpc3QgKG1vbml0b3JzLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgbl9tb25pdG9ycywKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDAsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkcHlpbmZvLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIlhpbmVyYW1hIik7 CisJCQkJCQkgICBuX21vbml0b3JzLAorCQkJCQkJICAgMCwKKwkJCQkJCSAgIGRweWluZm8sCisJ CQkJCQkgICAiWGluZXJhbWEiKTsKICAgZnJlZV9tb25pdG9ycyAobW9uaXRvcnMsIG5fbW9uaXRv cnMpOwogICByZXR1cm4gYXR0cmlidXRlc19saXN0OwogfQpAQCAtNDM5NCw2NCArNDM5NCw2NCBA QCB4X2dldF9tb25pdG9yX2F0dHJpYnV0ZXNfeHJhbmRyIChzdHJ1Y3QgeF9kaXNwbGF5X2luZm8g KmRweWluZm8pCiAgIGZvciAoaSA9IDA7IGkgPCBuX21vbml0b3JzOyArK2kpCiAgICAgewogICAg ICAgWFJST3V0cHV0SW5mbyAqaW5mbyA9IFhSUkdldE91dHB1dEluZm8gKGRweSwgcmVzb3VyY2Vz LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJlc291cmNl cy0+b3V0cHV0c1tpXSk7CisJCQkJCSAgICAgIHJlc291cmNlcy0+b3V0cHV0c1tpXSk7CiAgICAg ICBpZiAoIWluZm8pCiAJY29udGludWU7CiAKICAgICAgIGlmIChzdHJjbXAgKGluZm8tPm5hbWUs ICJkZWZhdWx0IikgPT0gMCkKLSAgICAgICAgewotICAgICAgICAgIC8qIE5vbiBYUmFuZHIgMS4y IGRyaXZlciwgZG9lcyBub3QgZ2l2ZSB1c2VmdWwgZGF0YS4gICovCisJeworCSAgLyogTm9uIFhS YW5kciAxLjIgZHJpdmVyLCBkb2VzIG5vdCBnaXZlIHVzZWZ1bCBkYXRhLiAgKi8KIAkgIFhSUkZy ZWVPdXRwdXRJbmZvIChpbmZvKTsKIAkgIFhSUkZyZWVTY3JlZW5SZXNvdXJjZXMgKHJlc291cmNl cyk7Ci0gICAgICAgICAgZnJlZV9tb25pdG9ycyAobW9uaXRvcnMsIG5fbW9uaXRvcnMpOwotICAg ICAgICAgIHJldHVybiBRbmlsOwotICAgICAgICB9CisJICBmcmVlX21vbml0b3JzIChtb25pdG9y cywgbl9tb25pdG9ycyk7CisJICByZXR1cm4gUW5pbDsKKwl9CiAKICAgICAgIGlmIChpbmZvLT5j b25uZWN0aW9uICE9IFJSX0Rpc2Nvbm5lY3RlZCAmJiBpbmZvLT5jcnRjICE9IE5vbmUpCi0gICAg ICAgIHsKLSAgICAgICAgICBYUlJDcnRjSW5mbyAqY3J0YyA9IFhSUkdldENydGNJbmZvIChkcHks IHJlc291cmNlcywgaW5mby0+Y3J0Yyk7Ci0gICAgICAgICAgc3RydWN0IE1vbml0b3JJbmZvICpt aSA9ICZtb25pdG9yc1tpXTsKLSAgICAgICAgICBYUmVjdGFuZ2xlIHdvcmthcmVhX3I7CisJewor CSAgWFJSQ3J0Y0luZm8gKmNydGMgPSBYUlJHZXRDcnRjSW5mbyAoZHB5LCByZXNvdXJjZXMsIGlu Zm8tPmNydGMpOworCSAgc3RydWN0IE1vbml0b3JJbmZvICptaSA9ICZtb25pdG9yc1tpXTsKKwkg IFhSZWN0YW5nbGUgd29ya2FyZWFfcjsKIAotICAgICAgICAgIGlmICghIGNydGMpCisJICBpZiAo ISBjcnRjKQogCSAgICB7CiAJICAgICAgWFJSRnJlZU91dHB1dEluZm8gKGluZm8pOwogCSAgICAg IGNvbnRpbnVlOwogCSAgICB9CiAKLSAgICAgICAgICBtaS0+Z2VvbS54ID0gY3J0Yy0+eDsKLSAg ICAgICAgICBtaS0+Z2VvbS55ID0gY3J0Yy0+eTsKLSAgICAgICAgICBtaS0+Z2VvbS53aWR0aCA9 IGNydGMtPndpZHRoOwotICAgICAgICAgIG1pLT5nZW9tLmhlaWdodCA9IGNydGMtPmhlaWdodDsK LSAgICAgICAgICBtaS0+bW1fd2lkdGggPSBpbmZvLT5tbV93aWR0aDsKLSAgICAgICAgICBtaS0+ bW1faGVpZ2h0ID0gaW5mby0+bW1faGVpZ2h0OwotICAgICAgICAgIG1pLT5uYW1lID0geHN0cmR1 cCAoaW5mby0+bmFtZSk7Ci0KLSAgICAgICAgICBpZiAocHhpZCAhPSBOb25lICYmIHB4aWQgPT0g cmVzb3VyY2VzLT5vdXRwdXRzW2ldKQotICAgICAgICAgICAgcHJpbWFyeSA9IGk7Ci0gICAgICAg ICAgZWxzZSBpZiAocHJpbWFyeSA9PSAtMSAmJiBzdHJjbXAgKGluZm8tPm5hbWUsICJMVkRTIikg PT0gMCkKLSAgICAgICAgICAgIHByaW1hcnkgPSBpOwotCi0gICAgICAgICAgaWYgKGkgPT0gcHJp bWFyeSAmJiB4X2dldF9uZXRfd29ya2FyZWEgKGRweWluZm8sICZ3b3JrYXJlYV9yKSkKLSAgICAg ICAgICAgIHsKLSAgICAgICAgICAgICAgbWktPndvcms9IHdvcmthcmVhX3I7Ci0gICAgICAgICAg ICAgIGlmICghIHhfaW50ZXJzZWN0X3JlY3RhbmdsZXMgKCZtaS0+Z2VvbSwgJm1pLT53b3JrLCAm bWktPndvcmspKQotICAgICAgICAgICAgICAgIG1pLT53b3JrID0gbWktPmdlb207Ci0gICAgICAg ICAgICB9Ci0gICAgICAgICAgZWxzZQotICAgICAgICAgICAgbWktPndvcmsgPSBtaS0+Z2VvbTsK LQotICAgICAgICAgIFhSUkZyZWVDcnRjSW5mbyAoY3J0Yyk7Ci0gICAgICAgIH0KKwkgIG1pLT5n ZW9tLnggPSBjcnRjLT54OworCSAgbWktPmdlb20ueSA9IGNydGMtPnk7CisJICBtaS0+Z2VvbS53 aWR0aCA9IGNydGMtPndpZHRoOworCSAgbWktPmdlb20uaGVpZ2h0ID0gY3J0Yy0+aGVpZ2h0Owor CSAgbWktPm1tX3dpZHRoID0gaW5mby0+bW1fd2lkdGg7CisJICBtaS0+bW1faGVpZ2h0ID0gaW5m by0+bW1faGVpZ2h0OworCSAgbWktPm5hbWUgPSB4c3RyZHVwIChpbmZvLT5uYW1lKTsKKworCSAg aWYgKHB4aWQgIT0gTm9uZSAmJiBweGlkID09IHJlc291cmNlcy0+b3V0cHV0c1tpXSkKKwkgICAg cHJpbWFyeSA9IGk7CisJICBlbHNlIGlmIChwcmltYXJ5ID09IC0xICYmIHN0cmNtcCAoaW5mby0+ bmFtZSwgIkxWRFMiKSA9PSAwKQorCSAgICBwcmltYXJ5ID0gaTsKKworCSAgaWYgKGkgPT0gcHJp bWFyeSAmJiB4X2dldF9uZXRfd29ya2FyZWEgKGRweWluZm8sICZ3b3JrYXJlYV9yKSkKKwkgICAg eworCSAgICAgIG1pLT53b3JrPSB3b3JrYXJlYV9yOworCSAgICAgIGlmICghIHhfaW50ZXJzZWN0 X3JlY3RhbmdsZXMgKCZtaS0+Z2VvbSwgJm1pLT53b3JrLCAmbWktPndvcmspKQorCQltaS0+d29y ayA9IG1pLT5nZW9tOworCSAgICB9CisJICBlbHNlCisJICAgIG1pLT53b3JrID0gbWktPmdlb207 CisKKwkgIFhSUkZyZWVDcnRjSW5mbyAoY3J0Yyk7CisJfQogICAgICAgWFJSRnJlZU91dHB1dElu Zm8gKGluZm8pOwogICAgIH0KICAgWFJSRnJlZVNjcmVlblJlc291cmNlcyAocmVzb3VyY2VzKTsK IAogICBhdHRyaWJ1dGVzX2xpc3QgPSB4X21ha2VfbW9uaXRvcl9hdHRyaWJ1dGVfbGlzdCAobW9u aXRvcnMsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBuX21vbml0b3JzLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgcHJpbWFyeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGRweWluZm8sCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAiWFJhbmRyIik7CisJCQkJCQkgICBuX21vbml0b3JzLAorCQkJCQkJ ICAgcHJpbWFyeSwKKwkJCQkJCSAgIGRweWluZm8sCisJCQkJCQkgICAiWFJhbmRyIik7CiAgIGZy ZWVfbW9uaXRvcnMgKG1vbml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mRpZgogCkBAIC00NjE3 LDEwICs0NjE3LDEwIEBAIEludGVybmFsIHVzZSBvbmx5LCB1c2UgYGRpc3BsYXktbW9uaXRvci1h dHRyaWJ1dGVzLWxpc3QnIGluc3RlYWQuICAqLykKICAgICB9CiAKICAgYXR0cmlidXRlc19saXN0 ID0gbWFrZV9tb25pdG9yX2F0dHJpYnV0ZV9saXN0IChtb25pdG9ycywKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBuX21vbml0b3JzLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByaW1hcnlfbW9uaXRvciwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBtb25pdG9y X2ZyYW1lcywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBzb3VyY2UpOworCQkJCQkJIG5fbW9uaXRvcnMsCisJCQkJCQkgcHJpbWFyeV9tb25pdG9yLAor CQkJCQkJIG1vbml0b3JfZnJhbWVzLAorCQkJCQkJIHNvdXJjZSk7CiAgIHVuYmxvY2tfaW5wdXQg KCk7CiAjZWxzZSAgLyogbm90IFVTRV9HVEsgKi8KIApAQCAtNDY2NCw3ICs0NjY0LDcgQEAgZnJh bWVfZ2VvbWV0cnkgKExpc3BfT2JqZWN0IGZyYW1lLCBMaXNwX09iamVjdCBhdHRyaWJ1dGUpCiAJ CSZpZ24sICZpZ24pOwogICAvKiogICBYR2V0V2luZG93QXR0cmlidXRlcyAoRlJBTUVfWF9ESVNQ TEFZIChmKSwgRlJBTUVfT1VURVJfV0lORE9XIChmKSwgJmF0dHMpOyAqKi8KICAgeF9yZWFsX3Bv c19hbmRfb2Zmc2V0cyAoZiwgJmxlZnRfb2ZmLCAmcmlnaHRfb2ZmLCAmdG9wX29mZiwgJmJvdHRv bV9vZmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIE5VTEwsIE5VTEwsICZ4cHRyLCAmeXB0 ciwgTlVMTCk7CisJCQkgIE5VTEwsIE5VTEwsICZ4cHRyLCAmeXB0ciwgTlVMTCk7CiAgIHVuYmxv Y2tfaW5wdXQgKCk7CiAKICAgLyoqICAgbmF0aXZlX3dpZHRoID0gYXR0cy53aWR0aDsgKiovCkBA IC00ODYyLDkgKzQ4NjIsOSBAQCBzZWxlY3RlZCBmcmFtZSdzIGRpc3BsYXkuICAqLykKIAogICBi bG9ja19pbnB1dCAoKTsKICAgWFF1ZXJ5UG9pbnRlciAoRlJBTUVfWF9ESVNQTEFZIChmKSwKLSAg ICAgICAgICAgICAgICAgRGVmYXVsdFJvb3RXaW5kb3cgKEZSQU1FX1hfRElTUExBWSAoZikpLAot ICAgICAgICAgICAgICAgICAmcm9vdCwgJmR1bW15X3dpbmRvdywgJngsICZ5LCAmZHVtbXksICZk dW1teSwKLSAgICAgICAgICAgICAgICAgKHVuc2lnbmVkIGludCAqKSAmZHVtbXkpOworCQkgRGVm YXVsdFJvb3RXaW5kb3cgKEZSQU1FX1hfRElTUExBWSAoZikpLAorCQkgJnJvb3QsICZkdW1teV93 aW5kb3csICZ4LCAmeSwgJmR1bW15LCAmZHVtbXksCisJCSAodW5zaWduZWQgaW50ICopICZkdW1t eSk7CiAgIHVuYmxvY2tfaW5wdXQgKCk7CiAKICAgcmV0dXJuIEZjb25zIChtYWtlX251bWJlciAo eCksIG1ha2VfbnVtYmVyICh5KSk7CkBAIC01MTUwLDcgKzUxNTAsNyBAQCB4X3N5bmMgKHN0cnVj dCBmcmFtZSAqZikKIAogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICBXaW5kb3cgcHJvcGVydGllcworCQkJICAgV2luZG93IHByb3BlcnRpZXMKICAqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq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aWVkIGZvcm1hdCBpcyAzMiwgdGhlIHByb3BlcnR5IGRhdGEgbXVzdCBiZSBhCkBA IC01MjIzLDcgKzUyMjMsNyBAQCBGUkFNRS4gIERlZmF1bHQgaXMgdG8gY2hhbmdlIG9uIHRoZSBl ZGl0IFggd2luZG93LiAgKi8pCiAgICAgICAvKiBTZWUgY29tbWVudCBhYm92ZSBhYm91dCBsb25n cyBhbmQgZm9ybWF0PTMyICovCiAgICAgICBlbHNpemUgPSBlbGVtZW50X2Zvcm1hdCA9PSAzMiA/ IHNpemVvZiAobG9uZykgOiBlbGVtZW50X2Zvcm1hdCA+PiAzOwogICAgICAgaWYgKFNCWVRFUyAo dmFsdWUpICUgZWxzaXplICE9IDApCi0gICAgICAgIGVycm9yICgiVkFMVUUgbXVzdCBjb250YWlu IGFuIGludGVncmFsIG51bWJlciBvZiBvY3RldHMgZm9yIEZPUk1BVCIpOworCWVycm9yICgiVkFM VUUgbXVzdCBjb250YWluIGFuIGludGVncmFsIG51bWJlciBvZiBvY3RldHMgZm9yIEZPUk1BVCIp OwogICAgICAgbmVsZW1lbnRzID0gU0JZVEVTICh2YWx1ZSkgLyBlbHNpemU7CiAgICAgfQogCkBA IC01Mjc2LDEyICs1Mjc2LDEyIEBAIEZSQU1FIG5pbCBvciBvbWl0dGVkIG1lYW5zIHVzZSB0aGUg c2VsZWN0ZWQgZnJhbWUuICBWYWx1ZSBpcyBQUk9QLiAgKi8pCiAKIHN0YXRpYyBMaXNwX09iamVj dAogeF93aW5kb3dfcHJvcGVydHlfaW50ZXJuIChzdHJ1Y3QgZnJhbWUgKmYsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgIFdpbmRvdyB0YXJnZXRfd2luZG93LAotICAgICAgICAgICAgICAgICAg ICAgICAgICBBdG9tIHByb3BfYXRvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgQXRvbSB0 YXJnZXRfdHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZGVsZXRl X3AsCi0gICAgICAgICAgICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHZlY3Rvcl9yZXRfcCwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgYm9vbCAqZm91bmQpCisJCQkgIFdpbmRvdyB0YXJn ZXRfd2luZG93LAorCQkJICBBdG9tIHByb3BfYXRvbSwKKwkJCSAgQXRvbSB0YXJnZXRfdHlwZSwK KwkJCSAgTGlzcF9PYmplY3QgZGVsZXRlX3AsCisJCQkgIExpc3BfT2JqZWN0IHZlY3Rvcl9yZXRf cCwKKwkJCSAgYm9vbCAqZm91bmQpCiB7CiAgIHVuc2lnbmVkIGNoYXIgKnRtcF9kYXRhID0gTlVM TDsKICAgTGlzcF9PYmplY3QgcHJvcF92YWx1ZSA9IFFuaWw7CkBAIC01MzAzLDQ3ICs1MzAzLDQ3 IEBAIHhfd2luZG93X3Byb3BlcnR5X2ludGVybiAoc3RydWN0IGZyYW1lICpmLAogICAgICAgdG1w X2RhdGEgPSBOVUxMOwogCiAgICAgICByYyA9IFhHZXRXaW5kb3dQcm9wZXJ0eSAoRlJBTUVfWF9E SVNQTEFZIChmKSwgdGFyZ2V0X3dpbmRvdywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBwcm9wX2F0b20sIDAsIGJ5dGVzX3JlbWFpbmluZywKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAhIE5JTFAgKGRlbGV0ZV9wKSwgdGFyZ2V0X3R5cGUsCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJmFjdHVhbF90eXBlLCAmYWN0dWFsX2Zvcm1hdCwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAmYWN0dWFsX3NpemUsICZieXRlc19yZW1haW5pbmcsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJnRtcF9kYXRhKTsKKwkJCSAgICAgICBwcm9wX2F0 b20sIDAsIGJ5dGVzX3JlbWFpbmluZywKKwkJCSAgICAgIC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Qcm9wZXJ0eSByZWZlcnMgdG8gdGhlCi0gICAgICAgICAgICAgcHJvcGVydHkgYW5k IHRob3NlIGFyZSBpbmRlZWQgaW4gMzIgYml0IHF1YW50aXRpZXMgaWYgZm9ybWF0IGlzCi0gICAg ICAgICAgICAgMzIuICAqLwotCi0gICAgICAgICAgaWYgKExPTkdfV0lEVEggPiAzMiAmJiBhY3R1 YWxfZm9ybWF0ID09IDMyKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICB1bnNpZ25lZCBs b25nIGk7Ci0gICAgICAgICAgICAgIGludCAgKmlkYXRhID0gKGludCAqKSB0bXBfZGF0YTsKLSAg ICAgICAgICAgICAgbG9uZyAqbGRhdGEgPSAobG9uZyAqKSB0bXBfZGF0YTsKLQotICAgICAgICAg ICAgICBmb3IgKGkgPSAwOyBpIDwgYWN0dWFsX3NpemU7ICsraSkKLSAgICAgICAgICAgICAgICBp ZGF0YVtpXSA9IChpbnQpIGxkYXRhW2ldOwotICAgICAgICAgICAgfQotCi0gICAgICAgICAgaWYg KE5JTFAgKHZlY3Rvcl9yZXRfcCkpCi0gICAgICAgICAgICBwcm9wX3ZhbHVlID0gbWFrZV9zdHJp bmcgKChjaGFyICopIHRtcF9kYXRhLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAoYWN0dWFsX2Zvcm1hdCA+PiAzKSAqIGFjdHVhbF9zaXplKTsKLSAgICAgICAgICBlbHNl Ci0gICAgICAgICAgICBwcm9wX3ZhbHVlID0geF9wcm9wZXJ0eV9kYXRhX3RvX2xpc3AgKGYsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRtcF9kYXRh LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBhY3R1 YWxfdHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgYWN0dWFsX2Zvcm1hdCwKLSAgICA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HlwZSksIEZhbHNlKTsKKwl0YXJnZXRfdHlwZSA9IFhJbnRl cm5BdG9tIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBTU0RBVEEgKHR5cGUpLCBGYWxzZSk7CiAgICAg fQogCiAgIHByb3BfYXRvbSA9IFhJbnRlcm5BdG9tIChGUkFNRV9YX0RJU1BMQVkgKGYpLCBTU0RB VEEgKHByb3ApLCBGYWxzZSk7CiAgIHByb3BfdmFsdWUgPSB4X3dpbmRvd19wcm9wZXJ0eV9pbnRl cm4gKGYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldF93 aW5kb3csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BfYXRv bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0X3R5cGUs Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRlbGV0ZV9wLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2ZWN0b3JfcmV0X3AsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZmb3VuZCk7CisJCQkJCSB0YXJn ZXRfd2luZG93LAorCQkJCQkgcHJvcF9hdG9tLAorCQkJCQkgdGFyZ2V0X3R5cGUsCisJCQkJCSBk ZWxldGVfcCwKKwkJCQkJIHZlY3Rvcl9yZXRfcCwKKwkJCQkJICZmb3VuZCk7CiAgIGlmIChOSUxQ IChwcm9wX3ZhbHVlKQogICAgICAgJiYgISBmb3VuZAogICAgICAgJiYgTklMUCAoc291cmNlKQog ICAgICAgJiYgdGFyZ2V0X3dpbmRvdyAhPSBGUkFNRV9PVVRFUl9XSU5ET1cgKGYpKQogICAgIHsK ICAgICAgIHByb3BfdmFsdWUgPSB4X3dpbmRvd19wcm9wZXJ0eV9pbnRlcm4gKGYsCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9PVVRFUl9XSU5ET1cg KGYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgcHJvcF9h dG9tLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgdGFyZ2V0 X3R5cGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBkZWxl dGVfcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHZlY3Rv cl9yZXRfcCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICZm b3VuZCk7CisJCQkJCSAgICAgRlJBTUVfT1VURVJfV0lORE9XIChmKSwKKwkJCQkJICAgICBwcm9w X2F0b20sCisJCQkJCSAgICAgdGFyZ2V0X3R5cGUsCisJCQkJCSAgICAgZGVsZXRlX3AsCisJCQkJ CSAgICAgdmVjdG9yX3JldF9wLAorCQkJCQkgICAgICZmb3VuZCk7CiAgICAgfQogCiAKQEAgLTU0 NzEsMTMgKzU0NzEsMTMgQEAgT3RoZXJ3aXNlLCB0aGUgcmV0dXJuIHZhbHVlIGlzIGEgdmVjdG9y IHdpdGggdGhlIGZvbGxvd2luZyBmaWVsZHM6CiAgICAgICAmJiB0YXJnZXRfd2luZG93ICE9IEZS QU1FX09VVEVSX1dJTkRPVyAoZikpCiAgICAgewogICAgICAgLyogYW5hbG9nb3VzIGJlaGF2aW9y IHRvIHgtd2luZG93LXByb3BlcnR5OiBpZiBwcm9wZXJ0eSBpc24ndCBmb3VuZAotICAgICAgICAg b24gdGhlIGZyYW1lJ3MgaW5uZXIgd2luZG93IGFuZCBubyBhbHRlcm5hdGUgd2luZG93IGlkIHdh cwotICAgICAgICAgcHJvdmlkZWQsIHRyeSB0aGUgZnJhbWUncyBvdXRlciB3aW5kb3cuICovCisJ IG9uIHRoZSBmcmFtZSdzIGlubmVyIHdpbmRvdyBhbmQgbm8gYWx0ZXJuYXRlIHdpbmRvdyBpZCB3 YXMKKwkgcHJvdmlkZWQsIHRyeSB0aGUgZnJhbWUncyBvdXRlciB3aW5kb3cuICovCiAgICAgICB0 YXJnZXRfd2luZG93ID0gRlJBTUVfT1VURVJfV0lORE9XIChmKTsKICAgICAgIHJjID0gWEdldFdp bmRvd1Byb3BlcnR5IChGUkFNRV9YX0RJU1BMQVkgKGYpLCB0YXJnZXRfd2luZG93LAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIHByb3BfYXRvbSwgMCwgMCwgRmFsc2UsIEFueVByb3Bl cnR5VHlwZSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmYWN0dWFsX3R5cGUsICZh Y3R1YWxfZm9ybWF0LCAmYWN0dWFsX3NpemUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgJmJ5dGVzX3JlbWFpbmluZywgJnRtcF9kYXRhKTsKKwkJCSAgICAgICBwcm9wX2F0b20sIDAs IDAsIEZhbHNlLCBBbnlQcm9wZXJ0eVR5cGUsCisJCQkgICAgICAgJmFjdHVhbF90eXBlLCAmYWN0 dWFsX2Zvcm1hdCwgJmFjdHVhbF9zaXplLAorCQkJICAgICAgICZieXRlc19yZW1haW5pbmcsICZ0 bXBfZGF0YSk7CiAgICAgfQogCiAgIGlmIChyYyA9PSBTdWNjZXNzICYmIGFjdHVhbF9mb3JtYXQg IT0gMCkKQEAgLTU0OTksNyArNTQ5OSw3IEBAIE90aGVyd2lzZSwgdGhlIHJldHVybiB2YWx1ZSBp cyBhIHZlY3RvciB3aXRoIHRoZSBmb2xsb3dpbmcgZmllbGRzOgogICoqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqLwog CiBzdGF0aWMgdm9pZCBjb21wdXRlX3RpcF94eSAoc3RydWN0IGZyYW1lICosIExpc3BfT2JqZWN0 LCBMaXNwX09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNwX09iamVjdCwg aW50LCBpbnQsIGludCAqLCBpbnQgKik7CisJCQkgICAgTGlzcF9PYmplY3QsIGludCwgaW50LCBp bnQgKiwgaW50ICopOwogCiAvKiBUaGUgZnJhbWUgb2YgYSBjdXJyZW50bHkgdmlzaWJsZSB0b29s dGlwLiAgKi8KIApAQCAtNTc0MCwxMiArNTc0MCwxMiBAQCB4X2NyZWF0ZV90aXBfZnJhbWUgKHN0 cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbywgTGlzcF9PYmplY3QgcGFybXMpCiAJCSAgICAg ICAvKiBCb3JkZXIuICAqLwogCQkgICAgICAgZi0+Ym9yZGVyX3dpZHRoLAogCQkgICAgICAgQ29w eUZyb21QYXJlbnQsIElucHV0T3V0cHV0LCBDb3B5RnJvbVBhcmVudCwKLSAgICAgICAgICAgICAg ICAgICAgICAgbWFzaywgJmF0dHJzKTsKKwkJICAgICAgIG1hc2ssICZhdHRycyk7CiAgICAgaW5p dGlhbF9zZXRfdXBfeF9iYWNrX2J1ZmZlciAoZik7CiAgICAgWENoYW5nZVByb3BlcnR5IChGUkFN RV9YX0RJU1BMQVkgKGYpLCB0aXBfd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgRlJBTUVf RElTUExBWV9JTkZPIChmKS0+WGF0b21fbmV0X3dpbmRvd190eXBlLAotICAgICAgICAgICAgICAg ICAgICAgWEFfQVRPTSwgMzIsIFByb3BNb2RlUmVwbGFjZSwKLSAgICAgICAgICAgICAgICAgICAg ICh1bnNpZ25lZCBjaGFyICopJnR5cGUsIDEpOworCQkgICAgIEZSQU1FX0RJU1BMQVlfSU5GTyAo ZiktPlhhdG9tX25ldF93aW5kb3dfdHlwZSwKKwkJICAgICBYQV9BVE9NLCAzMiwgUHJvcE1vZGVS ZXBsYWNlLAorCQkgICAgICh1bnNpZ25lZCBjaGFyICopJnR5cGUsIDEpOwogICAgIHVuYmxvY2tf aW5wdXQgKCk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SkKIAl7Ci0gICAgICAgICAgbW9uaXRvciA9IFhDQVIgKGF0 dHJpYnV0ZXMpOwotICAgICAgICAgIGdlb21ldHJ5ID0gRmFzc3EgKFFnZW9tZXRyeSwgbW9uaXRv cik7Ci0gICAgICAgICAgaWYgKENPTlNQIChnZW9tZXRyeSkpCi0gICAgICAgICAgICB7Ci0gICAg ICAgICAgICAgIG1pbl94ID0gWElOVCAoRm50aCAobWFrZV9udW1iZXIgKDEpLCBnZW9tZXRyeSkp OwotICAgICAgICAgICAgICBtaW5feSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgyKSwgZ2Vv bWV0cnkpKTsKLSAgICAgICAgICAgICAgbWF4X3ggPSBtaW5feCArIFhJTlQgKEZudGggKG1ha2Vf bnVtYmVyICgzKSwgZ2VvbWV0cnkpKTsKLSAgICAgICAgICAgICAgbWF4X3kgPSBtaW5feSArIFhJ TlQgKEZudGggKG1ha2VfbnVtYmVyICg0KSwgZ2VvbWV0cnkpKTsKLSAgICAgICAgICAgICAgaWYg KG1pbl94IDw9ICpyb290X3ggJiYgKnJvb3RfeCA8IG1heF94Ci0gICAgICAgICAgICAgICAgICAm JiBtaW5feSA8PSAqcm9vdF95ICYmICpyb290X3kgPCBtYXhfeSkKLSAgICAgICAgICAgICAgICB7 Ci0gICAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgICB9Ci0gICAgICAgICAg ICAgIG1heF95ID0gLTE7Ci0gICAgICAgICAgICB9Ci0KLSAgICAgICAgICBhdHRyaWJ1dGVzID0g WENEUiAoYXR0cmlidXRlcyk7CisJICBtb25pdG9yID0gWENBUiAoYXR0cmlidXRlcyk7CisJICBn ZW9tZXRyeSA9IEZhc3NxIChRZ2VvbWV0cnksIG1vbml0b3IpOworCSAgaWYgKENPTlNQIChnZW9t ZXRyeSkpCisJICAgIHsKKwkgICAgICBtaW5feCA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgx KSwgZ2VvbWV0cnkpKTsKKwkgICAgICBtaW5feSA9IFhJTlQgKEZudGggKG1ha2VfbnVtYmVyICgy KSwgZ2VvbWV0cnkpKTsKKwkgICAgICBtYXhfeCA9IG1pbl94ICsgWElOVCAoRm50aCAobWFrZV9u dW1iZXIgKDMpLCBnZW9tZXRyeSkpOworCSAgICAgIG1heF95ID0gbWluX3kgKyBYSU5UIChGbnRo IChtYWtlX251bWJlciAoNCksIGdlb21ldHJ5KSk7CisJICAgICAgaWYgKG1pbl94IDw9ICpyb290 X3ggJiYgKnJvb3RfeCA8IG1heF94CisJCSAgJiYgbWluX3kgPD0gKnJvb3RfeSAmJiAqcm9vdF95 IDwgbWF4X3kpCisJCXsKKwkJICBicmVhazsKKwkJfQorCSAgICAgIG1heF95ID0gLTE7CisJICAg IH0KKworCSAgYXR0cmlidXRlcyA9IFhDRFIgKGF0dHJpYnV0ZXMpOwogCX0KICAgICB9CiAKQEAg LTYxMDMsMTIgKzYxMDMsMTIgQEAgVGV4dCBsYXJnZXIgdGhhbiB0aGUgc3BlY2lmaWVkIHNpemUg aXMgY2xpcHBlZC4gICovKQogICAgICAgYmxvY2tfaW5wdXQgKCk7CiAgICAgICBvayA9IHhnX3By ZXBhcmVfdG9vbHRpcCAoZiwgc3RyaW5nLCAmd2lkdGgsICZoZWlnaHQpOwogICAgICAgaWYgKG9r KQotICAgICAgICB7CisJewogCSAgY29tcHV0ZV90aXBfeHkgKGYsIHBhcm1zLCBkeCwgZHksIHdp ZHRoLCBoZWlnaHQsICZyb290X3gsICZyb290X3kpOwotICAgICAgICAgIHhnX3Nob3dfdG9vbHRp cCAoZiwgcm9vdF94LCByb290X3kpOwotICAgICAgICAgIC8qIFRoaXMgaXMgdXNlZCBpbiBGeF9o aWRlX3RpcC4gICovCi0gICAgICAgICAgWFNFVEZSQU1FICh0aXBfZnJhbWUsIGYpOwotICAgICAg ICB9CisJICB4Z19zaG93X3Rvb2x0aXAgKGYsIHJvb3RfeCwgcm9vdF95KTsKKwkgIC8qIFRoaXMg aXM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YmIEZSQU1F X1hfRElTUExBWSAoZikgPT0gZXZlbnQueGtleS5kaXNwbGF5KQorCXsKKwkgIEtleVN5bSBrZXlz eW0gPSBYTG9va3VwS2V5c3ltICgmZXZlbnQueGtleSwgMCk7CiAKLSAgICAgICAgICAvKiBQb3Ag ZG93biBvbiBDLWcuICAqLwotICAgICAgICAgIGlmIChrZXlzeW0gPT0gWEtfZyAmJiAoZXZlbnQu eGtleS5zdGF0ZSAmIENvbnRyb2xNYXNrKSAhPSAwKQotICAgICAgICAgICAgWHRVbm1hbmFnZUNo aWxkIChkaWFsb2cpOwotICAgICAgICB9CisJICAvKiBQb3AgZG93biBvbiBDLWcuICAqLworCSAg aWYgKGtleXN5bSA9PSBYS19nICYmIChldmVudC54a2V5LnN0YXRlICYgQ29udHJvbE1hc2spICE9 IDApCisJICAgIFh0VW5tYW5hZ2VDaGlsZCAoZGlhbG9nKTsKKwl9CiAKICAgICAgICh2b2lkKSB4 X2Rpc3BhdGNoX2V2ZW50ICgmZXZlbnQsIEZSQU1FX1hfRElTUExBWSAoZikpOwogICAgIH0KQEAg LTY2MDEsOCArNjYwMSw4IEBAIHZhbHVlIG9mIERJUiBhcyBpbiBwcmV2aW91cyBpbnZvY2F0aW9u czsgdGhpcyBpcyBzdGFuZGFyZCBXaW5kb3dzIGJlaGF2aW9yLiAgKi8pCiAgICAgY2RlZl9maWxl ID0gU1NEQVRBIChkaXIpOwogCiAgIGZuID0geGdfZ2V0X2ZpbGVfbmFtZSAoZiwgU1NEQVRBIChw cm9tcHQpLCBjZGVmX2ZpbGUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgISBOSUxQIChtdXN0 bWF0Y2gpLAotICAgICAgICAgICAgICAgICAgICAgICAgICEgTklMUCAob25seV9kaXJfcCkpOwor CQkJICEgTklMUCAobXVzdG1hdGNoKSwKKwkJCSAhIE5JTFAgKG9ubHlfZGlyX3ApKTsKIAogICBp ZiAoZm4pCiAgICAgewpAQCAtNjY1Niw3ICs2NjU2LDc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cgKCJjYWlybyIpLCBRbmlsKTsKIAogICBERUZWQVJfTElTUCAoImNhaXJvLXZlcnNpb24tc3Ry aW5nIiwgVmNhaXJvX3ZlcnNpb25fc3RyaW5nLAotICAgICAgICAgICAgICAgZG9jOiAvKiBWZXJz aW9uIGluZm8gZm9yIGNhaXJvLiAgKi8pOworCSAgICAgICBkb2M6IC8qIFZlcnNpb24gaW5mbyBm b3IgY2Fpcm8uICAqLyk7CiAgIHsKICAgICBjaGFyIGNhaXJvX3ZlcnNpb25bc2l6ZW9mICIuLiIg KyAzICogSU5UX1NUUkxFTl9CT1VORCAoaW50KV07CiAgICAgaW50IGxlbiA9IHNwcmludGYgKGNh aXJvX3ZlcnNpb24sICIlZC4lZC4lZCIsCiAJCSAgICAgICBDQUlST19WRVJTSU9OX01BSk9SLCBD QUlST19WRVJTSU9OX01JTk9SLAotICAgICAgICAgICAgICAgICAgICAgICBDQUlST19WRVJTSU9O X01JQ1JPKTsKKwkJICAgICAgIENBSVJPX1ZFUlNJT05fTUlDUk8pOwogICAgIFZjYWlyb192ZXJz aW9uX3N0cmluZyA9IG1ha2VfcHVyZV9zdHJpbmcgKGNhaXJvX3ZlcnNpb24sIGxlbiwgbGVuLCBm YWxzZSk7CiAgIH0KICNlbmRpZgpkaWZmIC0tZ2l0IGEvc3JjL3hmb250LmMgYi9zcmMveGZvbnQu YwppbmRleCAwOWNhNjI4Li5iNWU3OTRhIDEwMDY0NAotLS0gYS9zcmMveGZvbnQuYworKysgYi9z cmMveGZvbnQuYwpAQCAtOTk1LDcgKzk5NSw3IEBAIHhmb250X3RleHRfZXh0ZW50cyAoc3RydWN0 IGZvbnQgKmZvbnQsIHVuc2lnbmVkIGludCAqY29kZSwKIAogc3RhdGljIGludAogeGZvbnRfZHJh dyAoc3RydWN0IGdseXBoX3N0cmluZyAqcywgaW50IGZyb20sIGludCB0bywgaW50IHgsIGludCB5 LAotICAgICAgICAgICAgYm9vbCB3aXRoX2JhY2tncm91bmQpCisJICAgIGJv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sbF93ZmRzKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgaWYgKHdmZHMg JiYgRkRfSVNTRVQgKGksIHdmZHMpKSArK3JldHZhbDsKLSAgICAgICAgICAgICAgZWxzZSArK291 cl9mZHM7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZSBpZiAod2ZkcykKLSAgICAgICAg ICAgIEZEX0NMUiAoaSwgd2Zkcyk7Ci0KLSAgICAgICAgICBpZiAoZWZkcyAmJiBGRF9JU1NFVCAo aSwgZWZkcykpCi0gICAgICAgICAgICArK3JldHZhbDsKLSAgICAgICAgfQorCXsKKwkgIGlmIChG RF9JU1NFVCAoaSwgJmFsbF9yZmRzKSkKKwkgICAgeworCSAgICAgIGlmIChyZmRzICYmIEZEX0lT U0VUIChpLCByZmRzKSkgKytyZXR2YWw7CisJICAgICAgZWxzZSArK291cl9mZHM7CisJICAgIH0K KwkgIGVsc2UgaWYgKHJmZHMpCisJICAgIEZEX0NMUiAoaSwgcmZkcyk7CisKKwkgIGlmIChoYXZl X3dmZHMgJiYgRkRfSVNTRVQgKGksICZhbGxfd2ZkcykpCisJICAgIHsKKwkgICAgICBpZiAod2Zk cyAmJiBGRF9JU1NFVCAoaSwgd2ZkcykpICsrcmV0dmFsOworCSAgICAgIGVsc2UgKytvdXJfZmRz OworCSAgICB9CisJICBlbHNlIGlmICh3ZmRzKQorCSAgICBGRF9DTFIgKGksIHdmZHMpOworCisJ ICBpZiAoZWZkcyAmJiBGRF9JU1NFVCAoaSwgZWZkcykpCisJICAgICsrcmV0dmFsOworCX0KICAg ICB9CiAKICAgLyogSWYgR3RrKyBpcyBpbiB1c2UgZXZlbnR1YWxseSBndGtfbWFpbl9pdGVyYXRp b24gd2lsbCBiZSBjYWxsZWQsCkBAIC0xNTQsMTEgKzE1NCwxMSBAQCB4Z19zZWxlY3QgKGludCBm ZHNfbGltLCBmZF9zZXQgKnJmZHMsIGZkX3NldCAqd2ZkcywgZmRfc2V0ICplZmRzL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0b25SZWxlYXNlLAotICAgICAgICAgZXZlbiBpZiBY dERpc3BhdGNoRXZlbnQgZG9lc24ndCBkbyB0aGF0LiAgKi8KKwkgQW5kIG1ha2Ugc3VyZSB0byBk ZWFjdGl2YXRlIGZvciBhbnkgQnV0dG9uUmVsZWFzZSwKKwkgZXZlbiBpZiBYdERpc3BhdGNoRXZl bnQgZG9lc24ndCBkbyB0aGF0LiAgKi8KICAgICAgIGlmIChldmVudC50eXBlID09IEJ1dHRvblJl bGVhc2UKLSAgICAgICAgICAmJiBkcHlpbmZvLT5kaXNwbGF5ID09IGV2ZW50LnhidXR0b24uZGlz cGxheSkKLSAgICAgICAgewotICAgICAgICAgIGRweWluZm8tPmdyYWJiZWQgJj0gfigxIDw8IGV2 ZW50LnhidXR0b24uYnV0dG9uKTsKKwkgICYmIGRweWluZm8tPmRpc3BsYXkgPT0gZXZlbnQueGJ1 dHRvbi5kaXNwbGF5KQorCXsKKwkgIGRweWluZm8tPmdyYWJiZWQgJj0gfigxIDw8IGV2ZW50Lnhi dXR0b24uYnV0dG9uKTsKICNpZmRlZiBVU0VfTU9USUYgLyogUHJldGVuZGluZyB0aGF0IHRoZSBl dmVudCBjYW1lIGZyb20gYQotICAgICAgICAgICAgICAgICAgICBCdG4xRG93biBzZWVtcyB0aGUg b25seSB3YXkgdG8gY29udmluY2UgTW90aWYgdG8KLSAgICAgICAgICAgICAgICAgICAgYWN0aXZh dGUgaXRzIGNhbGxiYWNrczsgc2V0dGluZyB0aGUgWG1ObWVudVBvc3QKLSAgICAgICAgICAgICAg ICAgICAgaXNuJ3Qgd29ya2luZy4gLS1tYXJjdXNAc3lzYy5wZHguZWR1LiAgKi8KLSAgICAgICAg ICBldmVudC54YnV0dG9uLmJ1dHRvbiA9IDE7Ci0gICAgICAgICAgLyogIE1vdGlmIG9ubHkgcG9w cyBkb3duIG1lbnVzIHdoZW4gbm8gQ3RybCwgQWx0IG9yIE1vZAotICAgICAgICAgICAgICBrZXkg aXMgcHJlc3Nl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i53aW5kb3cgPSBYdFdpbmRvdyAobGlzdFswXSk7CisJQXJnIGFsWzJdOworCVdpZGdldExp c3QgbGlzdDsKKwlDYXJkaW5hbCBucjsKKwlYdFNldEFyZyAoYWxbMF0sIFh0TmNoaWxkcmVuLCAm bGlzdCk7CisJWHRTZXRBcmcgKGFsWzFdLCBYdE5udW1DaGlsZHJlbiwgJm5yKTsKKwlYdEdldFZh bHVlcyAobWVudWJhciwgYWwsIDIpOworCWV2LnhidXR0b24ud2luZG93ID0gWHRXaW5kb3cgKGxp c3RbMF0pOwogICAgICAgfQogI2VuZGlmCiAKICAgICAgIFhUcmFuc2xhdGVDb29yZGluYXRlcyAo RlJBTUVfWF9ESVNQTEFZIChmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogRnJv bS13aW5kb3csIHRvLXdpbmRvdy4gICovCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2 LnhidXR0b24ud2luZG93LCBldi54YnV0dG9uLnJvb3QsCisJCQkgICAgIC8qIEZyb20td2luZG93 LCB0by13aW5kb3cuICAqLworCQkJICAgICBldi54YnV0dG9uLndpbmRvdywgZXYueGJ1dHRvbi5y b290LAogCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIC8qIEZyb20tcG9zaXRpb24sIHRv LXBvc2l0aW9uLiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZXYueGJ1dHRvbi54 LCBldi54YnV0dG9uLnksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICZldi54YnV0dG9u Lnhfcm9vdCwgJmV2LnhidXR0b24ueV9yb290LAorCQkJICAgICAvKiBGcm9tLXBvc2l0aW9uLCB0 by1wb3NpdGlvbi4gICovCisJCQkgICAgIGV2LnhidXR0b24ueCwgZXYueGJ1dHRvbi55LAorCQkJ ICAgICAmZXYueGJ1dHRvbi54X3Jvb3QsICZldi54YnV0dG9uLnlfcm9vdCwKIAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAvK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FtZSAqZiwgYm9vbCBmaXJzdF90aW1lLCBib29sIGRlZXBfcCkKICAgICAg IC8qIFRoZSBmb3VydGggYXJnIGlzIERFRVBfUCwgd2hpY2ggc2F5cyB0byBjb25zaWRlciB0aGUg ZW50aXJlCiAJIG1lbnUgdHJlZXMgd2Ugc3VwcGx5LCByYXRoZXIgdGhhbiBqdXN0IHRoZSBtZW51 IGJhciBpdGVtIG5hbWVzLiAgKi8KICAgICAgIHhnX21vZGlmeV9tZW51YmFyX3dpZGdldHMgKG1l bnViYXJfd2lkZ2V0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZiwKLSAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIGZpcnN0X3d2LAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgZGVlcF9wLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg R19DQUxMQkFDSyAobWVudWJhcl9zZWxlY3Rpb25fY2FsbGJhY2spLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgR19DQUxMQkFDSyAocG9wdXBfZGVhY3RpdmF0ZV9jYWxsYmFjayks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHX0NBTExCQUNLIChtZW51X2hpZ2hs aWdodF9jYWxsYmFjaykpOworCQkJCSBmLAorCQkJCSBmaXJzdF93diwKKwkJCQkgZGVlcF9wLAor CQkJCSBHX0NBTExCQUNLIChtZW51YmFyX3NlbGVjdGlvbl9jYWxsYmFjayksCisJCQkJIEdfQ0FM TEJBQ0sgKHBvcHVwX2RlYWN0aXZhdGVfY2FsbGJhY2spLAorCQkJCSBHX0NBTExCQUNLIChtZW51 X2hpZ2hsaWdodF9jYWxsYmFjaykpOwogICAgIH0KICAgZWxzZQogICAgIHsKICAgICAgIG1lbnVi YXJfd2lkZ2V0Ci0gICAgICAgID0geGdfY3JlYXRlX3dpZGdldCAoIm1lbnViYXIiLCAibWVudWJh ciIsIGYsIGZpcnN0X3d2LAot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AgICAgICAgICBGUkFNRV9Y X1dJTkRPVyAoZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgIEZSQU1FX0RJU1BMQVlf SU5GTyAoZiktPnJvb3Rfd2luZG93LAorCQkJICAgICAvKiBGcm9tLXdpbmRvdywgdG8td2luZG93 LiAgKi8KKwkJCSAgICAgRlJBTUVfWF9XSU5ET1cgKGYpLAorCQkJICAgICBGUkFNRV9ESVNQTEFZ X0lORk8gKGYpLT5yb290X3dpbmRvdywKIAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAv KiBGcm9tLXBvc2l0aW9uLCB0by1wb3NpdGlvbi4gICovCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgIHgsIHksICZ4LCAmeSwKKwkJCSAgICAgLyogRnJvbS1wb3NpdGlvbiwgdG8tcG9zaXRp b24uICAqLworCQkJICAgICB4LCB5LCAmeCwgJnksCiAKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgLyogQ2hpbGQgb2Ygd2luLiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JmR1bW15X3dpbmRvdyk7CisJCQkgICAgIC8qIENoaWxkIG9mIHdpbi4gICovCisJCQkgICAgICZk dW1teV93aW5kb3cpOwogICAgICAgdW5ibG9ja19pbnB1dCAoKTsKICAgICAgIHBvcHVwX3hfeS54 ID0geDsKICAgICAgIHBvcHVwX3hfeS55ID0geTsKQEAgLTEyNDIsOCArMTI0Miw4IEBAIGNyZWF0 ZV9hbmRfc2hvd19wb3B1cF9tZW51IChzdHJ1Y3QgZnJhbWUgKmYsIHdpZGdldF92YWx1ZSAqZmly c3Rfd3YsCiAgIGlmIChmb3JfY2xpY2spCiAgICAgewogICAgICAgZm9yIChpID0gMDsgaSA8IDU7 IGkrKykKLSAgICAgICAgaWYgKEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPmdyYWJiZWQgJiAoMSA8 PCBpKSkKLSAgICAgICAgICBicmVhazsKKwlpZiAoRlJBTUVfRElTUEx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ys Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICBmLT5vdXRwdXRfZGF0YS54LT53aWRnZXQsIHRy dWUsIDAsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwb3B1cF9zZWxlY3Rpb25fY2FsbGJh Y2ssCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBwb3B1cF9kZWFjdGl2YXRlX2NhbGxiYWNr LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgbWVudV9oaWdobGlnaHRfY2FsbGJhY2spOwor CQkJICAgZi0+b3V0cHV0X2RhdGEueC0+d2lkZ2V0LCB0cnVlLCAwLAorCQkJICAgcG9wdXBfc2Vs ZWN0aW9uX2NhbGxiYWNrLAorCQkJICAgcG9wdXBfZGVhY3RpdmF0ZV9jYWxsYmFjaywKKwkJCSAg IG1lbnVfaGlnaGxpZ2h0X2NhbGxiYWNrKTsKIAogICBldmVudC0+dHlwZSA9IEJ1dHRvblByZXNz OwogICBldmVudC0+c2VyaWFsID0gMDsKQEAgLTEzNDUsMTUgKzEzNDUsMTUgQEAgY3JlYXRlX2Fu ZF9zaG93X3BvcHVwX21lbnUgKHN0cnVjdCBmcmFtZSAqZiwgd2lkZ2V0X3ZhbHVlICpmaXJzdF93 diwKICAgeCArPSBGUkFNRV9MRUZUX1NDUk9MTF9CQVJfQVJFQV9XSURUSCAoZik7CiAgIFhUcmFu c2xhdGVDb29yZGluYXRlcyAoRlJBTUVfWF9ESVNQTEFZIChmKSwKIAotICAgICAgICAgICAgICAg ICAgICAgICAgIC8qIEZyb20td2luZG93LCB0by13aW5kb3cuICAqLwotICAgICAgICAgICAgICAg ICAgICAgICAgIEZSQU1FX1hfV0lORE9XIChmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICBG UkFNRV9ESVNQTEFZX0lORk8gKGYpLT5yb290X3dpbmRvdywKKwkJCSAvKiBGcm9tLXdpbmRvdywg dG8td2luZG93LiAgKi8KKwkJCSBGUkFNRV9YX1dJTkRPVyAoZiksCisJCQkgRlJBTUVfRElTUExB WV9JTkZPIChmKS0+cm9vdF93aW5kb3csCiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAvKiBG cm9tLXBvc2l0aW9uLCB0by1wb3NpdGlvbi4gICovCi0gICAgICAgICAgICAgICAgICAgICAgICAg eCwgeSwgJngsICZ5LAorCQkJIC8qIEZyb20tcG9zaXRpb24sIHRvLXBvc2l0aW9uLiAgKi8KKwkJ CSB4LCB5LCAmeCwgJnksCiAKLSAgICAgICAgICAgICAgICAgICAgICAgICAvKiBDaGlsZCBvZiB3 aW4uICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICZkdW1teV93aW5kb3cpOworCQkJIC8q IENoaWxkIG9mIHdpbi4gICovCisJCQkgJmR1bW15X3dpbmRvdyk7CiAgIHVuYmxvY2tfaW5wdXQg KCk7CiAKICAgZXZlbnQtPnhfcm9vdCA9IHg7CkBAIC0xNTEzLDEzICsxNTEzLDEzIEBAIHhfbWVu dV9zaG93IChzdHJ1Y3QgZnJhbWUgKmYsIGludCB4LCBpbnQgeSwgaW50IG1lbnVmbGFncywKIAkg IGhlbHAgPSBBUkVGIChtZW51X2l0ZW1zLCBpICsgTUVOVV9JVEVNU19JVEVNX0hFTFApOwogCiAj aWZuZGVmIEhBVkVfTVVMVElMSU5HVUFMX01FTlUKLSAgICAgICAgICBpZiAoU1RSSU5HUCAoaXRl bV9uYW1lKSAmJiBTVFJJTkdfTVVMVElCWVRFIChpdGVtX25hbWUpKQorCSAgaWYgKFNUUklOR1Ag KGl0ZW1fbmFtZSkgJiYgU1RSSU5HX01VTFRJQllURSAoaXRlbV9uYW1lKSkKIAkgICAgewogCSAg ICAgIGl0ZW1fbmFtZSA9IEVOQ09ERV9NRU5VX1NUUklORyAoaXRlbV9uYW1lKTsKIAkgICAgICBB U0VUIChtZW51X2l0ZW1zLCBpICsgTUVOVV9JVEVNU19JVEVNX05BTUUsIGl0ZW1fbmFtZSk7CiAJ ICAgIH0KIAotICAgICAgICAgIGlmIChTVFJJT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8gcHJvY2VzcyBpdC4g ICovCiAgIG1lbnVfaGVscF9mcmFtZSA9IGY7CiAgIHN0YXR1cyA9IFhNZW51QWN0aXZhdGUgKEZS QU1FX1hfRElTUExBWSAoZiksIG1lbnUsICZwYW5lLCAmc2VsaWR4LAotICAgICAgICAgICAgICAg ICAgICAgICAgICB4LCB5LCBCdXR0b25SZWxlYXNlTWFzaywgJmRhdGFwLAotICAgICAgICAgICAg ICAgICAgICAgICAgICBtZW51X2hlbHBfY2FsbGJhY2spOworCQkJICB4LCB5LCBCdXR0b25SZWxl YXNlTWFzaywgJmRhdGFwLAorCQkJICBtZW51X2hlbHBfY2FsbGJhY2spOwogICBwYW5lX3ByZWZp eCA9IFFuaWw7CiAKICAgc3dpdGNoIChzdGF0dXMpCmRpZmYgLS1naXQgYS9zcmMveG1sLmMgYi9z cmMveG1sLmMKaW5kZXggN2Q2MWRjNy4uNmZiNGIxNyAxMDA2NDQKLS0tIGEvc3JjL3htbC5jCisr KyBiL3NyYy94bWwuYwpAQCAtMjMxLDE4ICsyMzEsMTggQEAgcGFyc2VfcmVnaW9uIChMaXNwX09i amVjdCBzdGFydCwgTGlzcF9PYmplY3QgZW5kLCBMaXNwX09iamVjdCBiYXNlX3VybCwKICAgICB7 CiAgICAgICBMaXNwX09iamVjdCByID0gUW5pbDsKICAgICAgIGlmIChOSUxQKGRpc2NhcmRfY29t bWVudHMpKQotICAgICAgICB7Ci0gICAgICAgICAgLyogSWYgdGhlIGRvY3VtZW50IGhhcyB0b3Bs ZXZlbCBjb21tZW50cywgdGhlbiB0aGlzIHNob3VsZAotICAgICAgICAgICAgIGdldCB1cyB0aGUg bm9kZXMgYW5kIHRoZSBjb21tZW50cy4gKi8KLSAgICAgICAgICB4bWxOb2RlICpuID0gZG9jLT5j aGlsZHJlbjsKLQotICAgICAgICAgIHdoaWxlIChuKSB7Ci0gICAgICAgICAgICBpZiAoIU5JTFAg KHIpKQotICAgICAgICAgICAgICByZXN1bHQgPSBGY29ucyAociwg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pOwogICAgIH0KIAogICAvKiBDb252ZXJ0IGFueSBvdGhlciBraW5k IG9mIGRhdGEgdG8gYSB2ZWN0b3Igb2YgbnVtYmVycywgcmVwcmVzZW50ZWQKQEAgLTE2NDEsMjEg KzE2NDEsMjEgQEAgc2VsZWN0aW9uX2RhdGFfdG9fbGlzcF9kYXRhIChzdHJ1Y3QgeF9kaXNwbGF5 X2luZm8gKmRweWluZm8sCiAgICAgICBMaXNwX09iamVjdCB2ID0gbWFrZV91bmluaXRfdmVjdG9y IChzaXplIC8gMik7CiAKICAgICAgIGlmICh0eXBlID09IFhBX0lOVEVHRVIpCi0gICAgICAgIHsK LSAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZSAvIDI7IGkrKykKLSAgICAgICAgICAgIHsK LSAgICAgICAgICAgICAgc2hvcnQgaiA9ICgoc2hvcnQgKikgZGF0YSkgW2ldOwotICAgICAgICAg ICAgICBBU0VUICh2LCBpLCBtYWtlX251bWJlciAoaikpOwotICAgICAgICAgICAgfQotICAgICAg ICB9CisJeworCSAgZm9yIChpID0gMDsgaSA8IHNpemUgLyAyOyBpKyspCisJICAgIHsKKwkgICAg ICBzaG9ydCBqID0gKChzaG9ydCAqKSBkYXRhKSBbaV07CisJICAgICAgQVNFVCAodiwgaSwgbWFr ZV9udW1iZXIgKGopKTsKKwkgICAgfQorCX0KICAgICAgIGVsc2UKLSAgICAgICAgewotICAgICAg ICAgIGZvciAoaSA9IDA7IGkgPCBzaXplIC8gMjsgaSsrKQotICAgICAgICAgICAgewotICAgICAg ICAgICAgICB1bnNpZ25lZCBzaG9ydCBqID0gKCh1bnNpZ25lZCBzaG9ydCAqKSBkYXRhKSBbaV07 Ci0gICAgICAgICAgICAgIEFTRVQgKHYsIGksIG1ha2VfbnVtYmVyIChqKSk7Ci0gICAgICAgICAg ICB9Ci0gICAgICAgIH0KKwl7CisJICBmb3IgKGkgPSAwOyBpIDwgc2l6ZSAvIDI7IGkrKykKKwkg ICAgeworCSAgICAgIHVuc2lnbmVkIHNob3J0IGogPSAoKHVuc2lnbmVkIHNob3J0ICopIGRhdGEp IFtpXTsKKwkgICAgICBBU0VUICh2LCBpLCBtYWtlX251bWJlciAoaikpOworCSAgICB9CisJfQog ICAgICAgcmV0dXJuIHY7CiAgICAgfQogICBlbHNlCkBAIC0xNjY0LDIxICsxNjY0LDIxIEBAIHNl bGVjdGlvbl9kYXRhX3RvX2xpc3BfZGF0YSAoc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZv LAogICAgICAgTGlzcF9PYmplY3QgdiA9IG1ha2VfdW5pbml0X3ZlY3RvciAoc2l6ZSAvIFhfTE9O R19TSVpFKTsKIAogICAgICAgaWYgKHR5cGUgPT0gWEFfSU5URUdFUikKLSAgICAgICAgewotICAg ICAgICAgIGZvciAoaSA9IDA7IGkgPCBzaXplIC8gWF9MT05HX1NJWkU7IGkrKykKLSAgICAgICAg ICAgIHsKLSAgICAgICAgICAgICAgaW50IGogPSAoKGludCAqKSBkYXRhKSBbaV07Ci0gICAgICAg ICAgICAgIEFTRVQgKHYsIGksIElOVEVHRVJfVE9fQ09OUyAoaikpOwotICAgICAgICAgICAgfQot ICAgICAgICB9CisJeworCSAgZm9yIChpID0gMDsgaSA8IHNpemUgLyBYX0xPTkdfU0laRTsgaSsr KQorCSAgICB7CisJICAgICAgaW50IGogPSAoKGludCAqKSBkYXRhKSBbaV07CisJICAgICAgQVNF VCAodiwgaSwgSU5URUdFUl9UT19DT05TIChqKSk7CisJICAgIH0KKwl9CiAgICAgICBlbHNlCi0g ICAgICAgIHsKLSAgICAgICAgICBmb3IgKGkgPSAwOyBpIDwgc2l6ZSAvIFhfTE9OR19TSVpFOyBp KyspCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIHVuc2lnbmVkIGludCBqID0gKCh1bnNp Z25lZCBpbnQgKikgZGF0YSkgW2ldOwotICAgICAgICAgICAgICBBU0VUICh2LCBpLCBJTlRFR0VS X1RPX0NPTlMgKGopKTsKLSAgICAgICAgICAgIH0KLSAgICAgICAgfQorCXsKKwkgIGZvciAoaSA9 IDA7IGkgPCBzaXplIC8gWF9MT05HX1NJWkU7IGkrKykKKwkgICAgeworCSAgICAgIHVuc2lnbmVk IGludCBqID0gKCh1bnNpZ25lZCBpbnQgKikgZGF0YSkgW2ldOworCSAgICAgIEFTRVQgKHYsIGks IElOVEVHRVJfVE9fQ09OUyAoaikpOworCSAgICB9CisJfQogICAgICAgcmV0dXJuIHY7CiAgICAg fQogfQpAQCAtMjI0Nyw3ICsyMjQ3LDcgQEAgeF9jbGlwYm9hcmRfbWFuYWdlcl9zYXZlX2FsbCAo dm9pZCkKIAogDAogLyoqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqCi0gICAgICAgICAgICAgICAgICAgICAgRHJhZyBh bmQgZHJvcCBzdXBwb3J0CisJCSAgICAgIERyYWcgYW5kIGRyb3Agc3VwcG9ydAogKioqKioqKioq KioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioqKioq KioqKiovCiAvKiBDaGVjayB0aGF0IGxpc3AgdmFsdWVzIGFyZSBvZiBjb3JyZWN0IHR5cGUgZm9y IHhfZmlsbF9wcm9wZXJ0eV9kYXRhLgogICAgVGhhdCBpcywgbnVtYmVyLCBzdHJpbmcgb3IgYSBj b25zIHdpdGggdHdvIG51bWJlcnMgKGxvdyBhbmQgaGlnaCAxNgpAQCAtMjI2NSwxMCArMjI2NSwx MCBAQCB4X2NoZWNrX3Byb3BlcnR5X2RhdGEgKExpc3BfT2JqZWN0IGRhdGEpCiAgICAgICBMaXNw X09iamVjdCBvID0gWENBUiAoaXRlcik7CiAKICAgICAgIGlmICghIE5VTUJFUlAgKG8pICYmICEg U1RSSU5HUCAobykgJiYgISBDT05TUCAobykpCi0gICAgICAgIHJldHVybiAtMTsKKwlyZXR1cm4g LTE7CiAgICAgICBlbHNlIGlmIChDT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BsYXks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBTU0RBVEEgKG1lc3NhZ2VfdHlw ZSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGYWxzZSksCi0gICAgICAg ICAgICAgICAgICAgICAgIGZvcm1hdCwgdmFsdWVzKTsKKwkJICAgICAgIFhJbnRlcm5BdG9tIChk cHlpbmZvLT5kaXNwbGF5LAorCQkJCSAgICBTU0RBVEEgKG1lc3NhZ2VfdHlwZSksCisJCQkJICAg IEZhbHNlKSwKKwkJICAgICAgIGZvcm1hdCwgdmFsdWVzKTsKIAogICByZXR1cm4gUW5pbDsKIH0K IAogdm9pZAogeF9zZW5kX2NsaWVudF9ldmVudCAoTGlzcF9PYmplY3QgZGlzcGxheSwgTGlzcF9P YmplY3QgZGVzdCwgTGlzcF9PYmplY3QgZnJvbSwKLSAgICAgICAgICAgICAgICAgICAgIEF0b20g bWVzc2FnZV90eXBlLCBMaXNwX09iamVjdCBmb3JtYXQsIExpc3BfT2JqZWN0IHZhbHVlcykKKwkJ ICAgICBBdG9tIG1lc3NhZ2VfdHlwZSwgTGlzcF9PYmplY3QgZm9ybWF0LCBMaXNwX09iamVjdCB2 YWx1ZXMpCiB7CiAgIHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbyA9IGNoZWNrX3hfZGlz cGxheV9pbmZvIChkaXNwbGF5KTsKICAgV2luZG93IHdkZXN0OwpAQCAtMjU3NCwxMSArMjU3NCwx MSBAQCB4X3NlbmRfY2xpZW50X2V2ZW50IChMaXNwX09iamVjdCBkaXNwbGF5LCBMaXNwX09iamVj dCBkZXN0LCBMaXNwX09iamVjdCBmcm9tLAogICBlbHNlIGlmIChTVFJJTkdQIChkZXN0KSkKICAg ICB7CiAgICAgICBpZiAoc3RyY21wIChTU0RBVEEgKGRlc3QpLCAiUG9pbnRlcldpbmRvdyIpID09 IDApCi0gICAgICAgIHdkZXN0ID0gUG9pbnRlcldpbmRv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g ICAgICAgICAgZ2NoYXIgKmtleSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncG9p bnRlciB1c2VyX2RhdGEpCisJCQkgICAgICAgZ2NoYXIgKmtleSwKKwkJCSAgICAgICBncG9pbnRl ciB1c2VyX2RhdGEpCiB7CiAgIEdWYXJpYW50ICp2YWw7CiAKQEAgLTIxMyw0NCArMjEzLDQ0IEBA IHNvbWV0aGluZ19jaGFuZ2VkX2dzZXR0aW5nc0NCIChHU2V0dGluZ3MgKnNldHRpbmdzLAogICAg IHsKICAgICAgIHZhbCA9IGdfc2V0dGluZ3NfZ2V0X3ZhbHVlIChzZXR0aW5ncywgR1NFVFRJTkdT X1RPT0xfQkFSX1NUWUxFKTsKICAgICAgIGlmICh2YWwpCi0gICAgICAgIHsKLSAgICAgICAgICBn X3ZhcmlhbnRfcmVmX3NpbmsgKHZhbCk7Ci0gICAgICAgICAgaWYgKGdfdmFyaWFudF9pc19vZl90 eXBlICh2YWwsIEdfVkFSSUFOVF9UWVBFX1NUUklORykpCi0gICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgIGNvbnN0IGdjaGFyICpuZXdzdHlsZSA9IGdfdmFyaWFudF9nZXRfc3RyaW5nICh2YWws IE5VTEwpOwotICAgICAgICAgICAgICBzdG9yZV90b29sX2Jhcl9zdHlsZV9jaGFuZ2VkIChuZXdz dHlsZSwgZmlyc3RfZHB5aW5mbyk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZ192YXJpYW50 X3VucmVmICh2YWwpOwotICAgICAgICB9CisJeworCSAgZ192YXJpYW50X3JlZl9zaW5rICh2YWwp OworCSAgaWYgKGdfdmFyaWFudF9pc19vZl90eXBlICh2YWwsIEdfVkFSSUFOVF9UWVBFX1NUUklO RykpCisJICAgIHsKKwkgICAgICBjb25zdCBnY2hhciAqbmV3c3R5bGUgPSBnX3ZhcmlhbnRfZ2V0 X3N0cmluZyAodmFsLCBOVUxMKTsKKwkgICAgICBzdG9yZV90b29sX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vbmZDbGllbnQgKmNsaWVudCwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgIGd1aW50IGNueG5faWQsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICBHQ29uZkVudHJ5ICplbnRyeSwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgIGdwb2ludGVyIHVzZXJfZGF0YSkKKwkJCSAgIGd1aW50IGNueG5faWQsCisJCQkgICBHQ29u ZkVudHJ5ICplbnRyeSwKKwkJCSAgIGdwb2ludGVyIHVzZXJfZGF0YSkKIHsKICAgR0NvbmZWYWx1 ZSAqdiA9IGdjb25mX2VudHJ5X2dldF92YWx1ZSAoZW50cnkpOwogICBjb25zdCBjaGFyICprZXkg PSBnY29uZl9lbnRyeV9nZXRfa2V5IChlbnRyeSk7CkBAIC0zMjUsMTIgKzMyNSwxMiBAQCBnZXRf cHJvcF93aW5kb3cgKHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbykKIAogICBYR3JhYlNl cnZlciAoZHB5KTsKICAgZHB5aW5mby0+eHNldHRpbmdzX3dpbmRvdyA9IFhHZXRTZWxlY3Rpb25P d25lciAoZHB5LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBkcHlpbmZvLT5YYXRvbV94c2V0dGluZ3Nfc2VsKTsKKwkJCQkJCSAgZHB5aW5mby0+WGF0 b21feHNldHRpbmdzX3NlbCk7CiAgIGlmIChkcHlpbmZvLT54c2V0dGluZ3Nfd2luZG93ICE9IE5v bmUpCiAgICAgLyogU2VsZWN0IGV2ZW50cyBzbyB3ZSBjYW4gZGV0ZWN0IGlmIHdpbmRvdyBpcyBk ZWxldGVkIG9yIGlmIHNldHRpbmdzCiAgICAgICAgYXJlIGNoYW5nZWQuICAqLwogICAgIFhTZWxl Y3RJbnB1dCAoZHB5LCBkcHlpbmZvLT54c2V0dGluZ3Nfd2luZG93LAotICAgICAgICAgICAgICAg ICAgUHJvcGVydHlDaGFuZ2VNY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kaWYKIAogICAgICAgc3dpdGNoICh0eXBl KQotICAgICAgICB7Ci0gICAgICAgIGNhc2UgMDogLyogSW50ZWdlciAqLwotICAgICAgICAgIGlm IChieXRlc19wYXJzZWQgKyA0ID4gYnl0ZXMpIHJldHVybiBzZXR0aW5nc19zZWVuOwotICAgICAg ICAgIGlmICh3YW50X3RoaXMpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIG1lbWNweSAo Jml2YWwsIHByb3ArYnl0ZXNfcGFyc2VkLCA0KTsKLSAgICAgICAgICAgICAgaWYgKG15X2JvICE9 IHRoYXRfYm8pIGl2YWwgPSBic3dhcF8zMiAoaXZhbCk7Ci0gICAgICAgICAgICB9Ci0gICAgICAg ICAgYnl0ZXNfcGFyc2VkICs9IDQ7Ci0gICAgICAgICAgYnJlYWs7Ci0KLSAgICAgICAgY2FzZSAx OiAvKiBTdHJpbmcgKi8KLSAgICAgICAgICBpZiAoYnl0ZXNfcGFyc2VkICsgNCA+IGJ5dGVzKSBy ZXR1cm4gc2V0dGluZ3Nfc2VlbjsKLSAgICAgICAgICBtZW1jcHkgKCZ2bGVuLCBwcm9wK2J5dGVz X3BhcnNlZCwgNCk7Ci0gICAgICAgICAgYnl0ZXNfcGFyc2VkICs9IDQ7Ci0gICAgICAgICAgaWYg KG15X2JvICE9IHRoYXRfYm8pIHZsZW4gPSBic3dhcF8zMiAodmxlbik7Ci0gICAgICAgICAgaWYg KHdhbnRfdGhpcykKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgdG9fY3B5ID0gbWluICh2 bGVuLCBzaXplb2Ygc3ZhbCAtIDEpOwotICAgICAgICAgICAgICBtZW1jcHkgKHN2YWwsIHByb3Ar Ynl0ZXNfcGFyc2VkLCB0b19jcHkpOwotICAgICAgICAgICAgICBzdmFsW3RvX2NweV0gPSAnXDAn OwotICAgICAgICAgICAgfQotICAgICAgICAgIGJ5dGVzX3BhcnNlZCArPSB2bGVuOwotICAgICAg ICAgIGJ5dGVzX3Bh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TsKKwkgICAgICBz ZXR0aW5ncy0+YWEgPSBpdmFsICE9IDA7CisJICAgIH0KKwkgIGVsc2UgaWYgKHN0cmNtcCAobmFt ZSwgIlhmdC9IaW50aW5nIikgPT0gMCkKKwkgICAgeworCSAgICAgIHNldHRpbmdzLT5zZWVuIHw9 IFNFRU5fSElOVElORzsKKwkgICAgICBzZXR0aW5ncy0+aGludGluZyA9IGl2YWwgIT0gMDsKKwkg ICAgfQogIyBpZmRlZiBGQ19ISU5UX1NUWUxFCi0gICAgICAgICAgZWxzZSBpZiAoc3RyY21wIChu YW1lLCAiWGZ0L0hpbnRTdHlsZSIpID09IDApCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAg IHNldHRpbmdzLT5zZWVuIHw9IFNFRU5fSElOVFNUWUxFOwotICAgICAgICAgICAgICBpZiAoc3Ry Y21wIChzdmFsLCAiaGludG5vbmUiKSA9PSAwKQotICAgICAgICAgICAgICAgIHNldHRpbmdzLT5o aW50c3R5bGUgPSBGQ19ISU5UX05PTkU7Ci0gICAgICAgICAgICAgIGVsc2UgaWYgKHN0cmNtcCAo c3ZhbCwgImhpbnRzbGlnaHQiKSA9PSAwKQotICAgICAgICAgICAgICAgIHNldHRpbmdzLT5oaW50 c3R5bGUgPSBGQ19ISU5UX1NMSUdIVDsKLSAgICAgICAgICAgICAgZWxzZSBpZiAoc3RyY21wIChz dmFsLCAiaGludG1lZGl1bSIpID09IDApCi0gICAgICAgICAgICAgICAgc2V0dGluZ3MtPmhpbnRz dHlsZSA9IEZDX0hJTlRfTUVESVVNOwotICAgICAgICAgICAgICBlbHNlIGlmIChzdHJjbXAgKHN2 YWwsICJoaW50ZnVsbCIpID09IDApCi0gICAgICAgICAgICAgICAgc2V0dGluZ3MtPmhpbnRzdHls ZSA9IEZDX0hJTlRfRlVMTDsKLSAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgIHNl dHRpbmdzLT5zZWVuICY9IH5TRUVOX0hJTlRTVFlMRTsKLSAgICA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kFfUkdCOwotICAgICAgICAgICAgICBlbHNlIGlmIChzdHJjbXAgKHN2YWws ICJiZ3IiKSA9PSAwKQotICAgICAgICAgICAgICAgIHNldHRpbmdzLT5yZ2JhID0gRkNfUkdCQV9C R1I7Ci0gICAgICAgICAgICAgIGVsc2UgaWYgKHN0cmNtcCAoc3ZhbCwgInZyZ2IiKSA9PSAwKQot ICAgICAgICAgICAgICAgIHNldHRpbmdzLT5yZ2JhID0gRkNfUkdCQV9WUkdCOwotICAgICAgICAg ICAgICBlbHNlIGlmIChzdHJjbXAgKHN2YWwsICJ2YmdyIikgPT0gMCkKLSAgICAgICAgICAgICAg ICBzZXR0aW5ncy0+cmdiYSA9IEZDX1JHQkFfVkJHUjsKLSAgICAgICAgICAgICAgZWxzZQotICAg ICAgICAgICAgICAgIHNldHRpbmdzLT5zZWVuICY9IH5TRUVOX1JHQkE7Ci0gICAgICAgICAgICB9 Ci0gICAgICAgICAgZWxzZSBpZiAoc3RyY21wIChuYW1lLCAiWGZ0L0RQSSIpID09IDAgJiYgaXZh bCAhPSAoQ0FSRDMyKSAtMSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgc2V0dGluZ3Mt PnNlZW4gfD0gU0VFTl9EUEk7Ci0gICAgICAgICAgICAgIHNldHRpbmdzLT5kcGkgPSBpdmFsIC8g MTAyNC4wOwotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKHN0cmNtcCAobmFtZSwg IlhmdC9sY2RmaWx0ZXIiKSA9PSAwKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBzZXR0 aW5ncy0+c2VlbiB8PSBTRUVOX0xDREZJTFRFUjsKLSAgICAgICAgICAgICAgaWYgKHN0cmNtcCAo c3ZhbCwgIm5vbmUiKSA9PSAwKQotICAgICAgICAgICAgICAgIHNldHRpbmdzLT5sY2RmaWx0ZXIg PSBGQ19MQ0RfTk9ORTsKLSAgICAgICAgICAgICAgZWxzZSBpZiAoc3RyY21wIChzdmFsLCAib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nRiX3N0eWxlKTsKICAgICAgIHhmcmVl IChzZXR0aW5ncy50Yl9zdHlsZSk7CiAgICAgfQogI2lmZGVmIEhBVkVfWEZUCiAgIGlmIChzZXR0 aW5ncy5zZWVuICYgU0VFTl9GT05UKQogICAgIHsKICAgICAgIGlmIChzZW5kX2V2ZW50X3ApCi0g ICAgICAgIHN0b3JlX2ZvbnRfbmFtZV9jaGFuZ2VkIChzZXR0aW5ncy5mb250KTsKKwlzdG9yZV9m b250X25hbWVfY2hhbmdlZCAoc2V0dGluZ3MuZm9udCk7CiAgICAgICBlbHNlCiAJZHVwc3RyaW5n ICgmY3VycmVudF9mb250LCBzZXR0aW5ncy5mb250KTsKICAgICAgIHhmcmVlIChzZXR0aW5ncy5m b250KTsKQEAgLTc1NSwyMSArNzU1LDIxIEBAIHhmdF9zZXR0aW5nc19ldmVudCAoc3RydWN0IHhf ZGlzcGxheV9pbmZvICpkcHlpbmZvLCBjb25zdCBYRXZlbnQgKmV2ZW50KQogICAgIHsKICAgICBj YXNlIERlc3Ryb3lOb3RpZnk6CiAgICAgICBpZiAoZHB5aW5mby0+eHNldHRpbmdzX3dpbmRvdyA9 PSBldmVudC0+eGFueS53aW5kb3cpCi0gICAgICAgIGNoZWNrX3dpbmRvd19wID0gdHJ1ZTsKKwlj aGVja193aW5kb3dfcCA9IHRydWU7CiAgICAgICBicmVhazsKIAogICAgIGNhc2UgQ2xpZW50TWVz c2FnZToKICAgICAgIGlmIChldmVudC0+eGNsaWVudC5tZXNzYWdlX3R5cGUgPT0gZHB5aW5mby0+ WGF0b21feHNldHRpbmdzX21ncgotICAgICAgICAgICYmIGV2ZW50LT54Y2xpZW50LmRhdGEubFsx XSA9PSBkcHlpbmZvLT5YYXRvbV94c2V0dGluZ3Nfc2VsCi0gICAgICAgICAgJiYgZXZlbnQtPnhj bGllbnQud2luZG93ID09IGRweWluZm8tPnJvb3Rfd2luZG93KQotICAgICAgICBjaGVja193aW5k b3dfcCA9IHRydWU7CisJICAmJiBld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nc2V0dGluZ3MgKHZvaWQpCiAgICAgewogICAgICAgZ192YXJpYW50X3JlZl9zaW5rICh2 YWwpOwogICAgICAgaWYgKGdfdmFyaWFudF9pc19vZl90eXBlICh2YWwsIEdfVkFSSUFOVF9UWVBF X1NUUklORykpCi0gICAgICAgIGR1cHN0cmluZyAoJmN1cnJlbnRfZm9udCwgZ192YXJpYW50X2dl dF9zdHJpbmcgKHZhbCwgTlVMTCkpOworCWR1cHN0cmluZyAoJmN1cnJlbnRfZm9udCwgZ192YXJp YW50X2dldF9zdHJpbmcgKHZhbCwgTlVMTCkpOwogICAgICAgZ192YXJpYW50X3VucmVmICh2YWwp OwogICAgIH0KICNlbmRpZiAvKiBIQVZFX1hGVCAqLwpAQCAtODcyLDEzICs4NzIsMTMgQEAgaW5p dF9nY29uZiAodm9pZCkKICAgZ2NvbmZfY2xpZW50ID0gZ2NvbmZfY2xpZW50X2dldF9kZWZhdWx0 ICgpOwogICBnY29uZl9jbGllbnRfc2V0X2Vycm9yX2hhbmRsaW5nIChnY29uZl9jbGllbnQsIEdD T05GX0NMSUVOVF9IQU5ETEVfTk9ORSk7CiAgIGdjb25mX2NsaWVudF9hZGRfZGlyIChnY29uZl9j bGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICBHQ09ORl9UT09MX0JBUl9TVFlMRSwKLSAg ICAgICAgICAgICAgICAgICAgICAgIEdDT05GX0NMSUVOVF9QUkVMT0FEX09ORUxFVkVMLAotICAg ICAgICAgICAgICAgICAgICAgICAgTlVMTCk7CisJCQlHQ09ORl9UT09MX0JBUl9TVFlMRSwKKwkJ CUdDT05GX0NMSUVOVF9QUkVMT0FEX09ORUxFVkVMLAorCQkJTlVMTCk7CiAgIGdjb25mX2NsaWVu dF9ub3RpZnlfYWRkIChnY29uZl9jbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBH Q09ORl9UT09MX0JBUl9TVFlMRSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvbWV0aGlu Z19jaGFuZ2VkX2djb25mQ0IsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBOVUxM LCBOVUxMKTsKKwkJCSAgIEdDT05GX1RPT0xfQkFSX1NUWUxFLAorCQkJICAgc29tZXRoaW5nX2No YW5nZWRfZ2NvbmZDQiwKKwkJCSAgIE5VTEwsIE5VTEwsIE5VTEwpOwogCiAgIHMgPSBnY29uZl9j bGllbnRfZ2V0X3N0cmluZyAoZ2NvbmZfY2xpZW50LCBHQ09ORl9UT09MX0JBUl9TVFlMRSwgTlVM TCk7CiAgIGlmIChzKQpAQCAtOTAxLDIxICs5MDEsMjEgQEAgaW5pdF9nY29uZiAodm9pZCkKICAg ICAgIGdfZnJlZSAocyk7CiAgICAgfQogICBnY29uZl9jbGllbnRfYWRkX2RpciAoZ2NvbmZfY2xp ZW50LAotICAgICAgICAgICAgICAgICAgICAgICAgR0NPTkZfTU9OT19GT05ULAotICAgICAgICAg ICAgICAgICAgICAgICAgR0NPTkZfQ0xJRU5UX1BSRUxPQURfT05FTEVWRUwsCi0gICAgICAgICAg ICAgICAgICAgICAgICBOVUxMKTsKKwkJCUdDT05GX01PTk9fRk9OVCwKKwkJCUdDT05GX0NMSUVO VF9QUkVMT0FEX09ORUxFVkVMLAorCQkJTlVMTCk7CiAgIGdjb25mX2NsaWVudF9ub3RpZnlfYWRk IChnY29uZl9jbGllbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBHQ09ORl9NT05PX0ZP TlQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBzb21ldGhpbmdfY2hhbmdlZF9nY29uZkNC LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgTlVMTCwgTlVMTCwgTlVMTCk7CisJCQkgICBH Q09ORl9NT05PX0ZPTlQsCisJCQkgICBzb21ldGhpbmdfY2hhbmdlZF9nY29uZkNCLAorCQkJICAg TlVMTCwgTlVMTCwgTlVMTCk7CiAgIGdjb25mX2NsaWVudF9hZGRfZGlyIChnY29uZl9jbGllbnQs Ci0gICAgICAgICAgICAgICAgICAgICAgICBHQ09ORl9GT05UX05BTUUsCi0gICAgICAgICAgICAg ICAgICAgICAgICBHQ09ORl9DTElFTlRfUFJFTE9BRF9PTkVMRVZFTCwKLSAgICAgICAgICAgICAg ICAgICAgICAgIE5VTEwpOworCQkJR0NPTkZfRk9OVF9OQU1FLAorCQkJR0NPTkZfQ0xJRU5UX1BS RUxPQURfT05FTEVWRUwsCisJCQlOVUxMKTsKICAgZ2NvbmZfY2xpZW50X25vdGlmeV9hZGQgKGdj b25mX2NsaWVudCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIEdDT05GX0ZPTlRfTkFNRSwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvbWV0aGluZ19jaGFuZ2VkX2djb25mQ0IsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCBOVUxMLCBOVUxMKTsKKwkJCSAgIEdDT05G X0ZPTlRfTkFNRSwKKwkJCSAgIHNvbWV0aGluZ19jaGFuZ2VkX2djb25mQ0IsCisJCQkgICBOVUxM LCBOVUxMLCBOVUxMKTsKICNlbmRpZiAvKiBIQVZFX1hGVCAqLwogI2VuZGlmIC8qIEhBVkVfR0NP TkYgKi8KIH0KQEAgLTEwMzEsNyArMTAzMSw3IEBAIElmIHRoaXMgdmFyaWFibGUgaXMgbmlsLCBF bWFjcyBpZ25vcmVzIHN5c3RlbSBmb250IGNoYW5nZXMuICAqLyk7CiAgIHVzZV9zeXN0ZW1fZm9u dCA9IGZhbHNlOwogCiAgIERFRlZBUl9MSVNQICgieGZ0LXNldHRpbmdzIiwgVnhmdF9zZXR0aW5n cywKLSAgICAgICAgICAgICAgIGRvYzogLyogRm9udCBzZXR0aW5ncyBhcHBsaWVkIHRvIFhmdC4g ICovKTsKKwkgICAgICAgZG9jOiAvKiBGb250IHNldHRpbmdzIGFwcGxpZWQgdG8gWGZ0LiAgKi8p OwogICBWeGZ0X3NldHRpbmdzID0gZW1wdHlfdW5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saWVudF9JRCkK ICAgWENsYXNzSGludCBjbGFzc19oaW50czsKIAogICB3ID0gWENyZWF0ZVNpbXBsZVdpbmRvdyAo ZHB5aW5mby0+ZGlzcGxheSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIGRweWluZm8tPnJv b3Rfd2luZG93LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgLTEsIC0xLCAxLCAxLAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgQ29weUZyb21QYXJlbnQsIENvcHlGcm9tUGFyZW50LCBD b3B5RnJvbVBhcmVudCk7CisJCQkgICBkcHlpbmZvLT5yb290X3dpbmRvdywKKwkJCSAgIC0xLCAt MSwgMSwgMSwKKwkJCSAgIENvcHlGcm9tUGFyZW50LCBDb3B5RnJvbVBhcmVudCwgQ29weUZyb21Q YXJlbnQpOwogCiAgIHZhbGlkYXRlX3hfcmVzb3VyY2VfbmFtZSAoKTsKICAgY2xhc3NfaGludHMu cmVzX25hbWUgPSBTU0RBVEEgKFZ4X3Jlc291cmNlX25hbWUpOwpAQCAtMzgxLDggKzM4MSw4IEBA IGNyZWF0ZV9jbGllbnRfbGVhZGVyX3dpbmRvdyAoc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlp bmZvLCBjaGFyICpjbGllbnRfSUQpCiAgIFhTdG9yZU5hbWUgKGRweWluZm8tPmRpc3BsYXksIHcs IGNsYXNzX2hpbnRzLnJlc19uYW1lKTsKIAogICBYQ2hhbmdlUHJvcGVydHkgKGRweWluZm8tPmRp c3BsYXksIHcsIGRweWluZm8tPlhhdG9tX1NNX0NMSUVOVF9JRCwKLSAgICAgICAgICAgICAgICAg ICBYQV9TVFJJTkcsIDgsIFByb3BNb2RlUmVwbGFjZSwKLSAgICAgICAgICAgICAgICAgICAodW5z aWduZWQgY2hhciAqKSBjbGllbnRfSUQsIHN0cmxlbiAoY2xpZW50X0lEKSk7CisJCSAgIFhBX1NU UklORywgOCwgUHJvcE1vZGVSZXBsYWNlLAorCQkgICAodW5zaWduZWQgY2hhciAqKSBjbGllbnRf SUQsIHN0cmxlbiAoY2xpZW50X0lEKSk7CiAKICAgZHB5aW5mby0+Y2xpZW50X2xlYWRlcl93aW5k b3cgPSB3OwogfQpAQCAtNDA0LDcgKzQwNCw3IEBAIHhfc2Vzc2lvbl9pbml0aWFsaXplIChzdHJ1 Y3QgeF9kaXNwbGF5X2luZm8gKmRweWluZm8pCiAgIGlmICghIGVtYWNzX2dldF9jdXJyZW50X2Rp cl9uYW1lICgpKQogICAgIHsKICAgICAgIGZwcmludGYgKHN0ZGVyciwgIkRpc2FibGluZyBzZXNz aW9uIG1hbmFnZW1lbnQgZHVlIHRvIHB3ZCBlcnJvcjogJXNcbiIsCi0gICAgICAgICAgICAgICBl bWFjc19zdHJlcnJvciAoZXJybm8pKTsKKwkgICAgICAgZW1hY3Nfc3RyZXJyb3IgKGVycm5vKSk7 CiAgICAgICByZXR1cm47CiAgICAgfQogCkBAIC00NTUsMTUgKzQ1NSwxNSBAQCB4X3Nlc3Npb25f aW5pdGlhbGl6ZSAoc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvKQogICAgICBjcml0aWNh bCwgaXQgdXN1YWxseSBtZWFucyB0aGF0IG5vIHNlc3Npb24gbWFuYWdlciBpcyBydW5uaW5nLgog ICAgICBUaGUgZXJyb3JzdHJpbmcgaXMgaGVyZSBmb3IgZGVidWdnaW5nLiAgKi8KICAgc21jX2Nv bm4gPSBTbWNPcGVuQ29ubmVjdGlvbiAoTlVMTCwgTlVMTCwgMSwgMCwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgKFNtY1NhdmVZb3Vyc2VsZlByb2NNYXNrfAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgU21jRGllUHJvY01hc2t8Ci0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICBTbWNTYXZlQ29tcGxldGVQcm9jTWFza3wKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgIFNtY1NodXRkb3duQ2FuY2VsbGVkUHJvY01hc2spLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmY2FsbGJhY2tzLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBwcmV2aW91c19pZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg JmNsaWVudF9pZCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgU01fRVJST1JTVFJJ TkdfTEVOLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBlcnJvcnN0cmluZyk7CisJ CQkJKFNtY1NhdmVZb3Vyc2VsZlByb2NNYXNrfAorCQkJCSBTbWNEaWVQcm9jTWFza3wKKwkJCQkg U21jU2F2ZUNvbXBsZXRlUHJvY01hc2t8CisJCQkJIFNtY1NodXRkb3duQ2FuY2VsbGVkUHJvY01h c2spLAorCQkJCSZjYWxsYmFja3MsCisJCQkJcHJldmlvdXNfaWQsCisJCQkJJmNsaWVudF9pZCwK KwkJCQlTTV9FUlJPUlNUUklOR19MRU4sCisJCQkJZXJyb3JzdHJpbmcpOwogCiAgIGlmIChzbWNf Y29ubiAhPSAwKQogICAgIHsKQEAgLTQ3MSw3ICs0NzEsNyBAQCB4X3Nlc3Npb25faW5pdGlhbGl6 ZSAoc3RydWN0IHhfZGlzcGxheV9pbmZvICpkcHlpbmZvKQogCiAjaWZkZWYgVVNFX0dUSwogICAg ICAgLyogR1RLIGNyZWF0ZXMgYSBsZWFkZXIgd2luZG93IGJ5IGl0c2VsZiwgYnV0IHdlIG5lZWQg dG8gdGVsbAotICAgICAgICAgaXQgYWJvdXQgb3VyIGNsaWVudF9pZC4gICovCisJIGl0IGFib3V0 IG91ciBjbGllbnRfaWQuICAqLwogICAgICAgZ2RrX3gxMV9zZXRfc21fY2xpZW50X2lkIChjbGll bnRfaWQpOwogI2Vsc2UKICAgICAgIGNyZWF0ZV9jbGllbnRfbGVhZGVyX3dpbmRvdyAoZHB5aW5m bywgY2xpZW50X2lkKT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AgICAgICAgICAgICAg ICAgIFRpbWUgKik7CisJCQkJCWVudW0gc2Nyb2xsX2Jhcl9wYXJ0ICosCisJCQkJCUxpc3BfT2Jq ZWN0ICosIExpc3BfT2JqZWN0ICosCisJCQkJCVRpbWUgKik7CiBzdGF0aWMgdm9pZCB4X2hvcml6 b250YWxfc2Nyb2xsX2Jhcl9yZXBvcnRfbW90aW9uIChzdHJ1Y3QgZnJhbWUgKiosIExpc3BfT2Jq ZWN0ICosCiAJCQkJCQkgICBlbnVtIHNjcm9sbF9iYXJfcGFydCAqLAogCQkJCQkJICAgTGlzcF9P YmplY3QgKiwgTGlzcF9PYmplY3QgKiwKQEAgLTM2MSwxOCArMzYxLDE4IEBAIHhfYmVnaW5fY3Jf Y2xpcCAoc3RydWN0IGZyYW1lICpmLCBHQyBnYykKICAgICB7CiAKICAgICAgIGlmICghIEZSQU1F X0NSX1NVUkZBQ0UgKGYpKQotICAgICAgICB7Ci0gICAgICAgICAgY2Fpcm9fc3VyZmFjZV90ICpz dXJmYWNlOwotICAgICAgICAgIHN1cmZhY2UgPSBjYWlyb194bGliX3N1cmZhY2VfY3JlYXRlIChG UkFNRV9YX0RJU1BMQVkgKGYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICBGUkFNRV9YX0RSQVdBQkxFIChmKSwKLSAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgRlJBTUVfRElTUExBWV9JTkZPIChmKS0+dmlzdWFsLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9QSVhF TF9XSURUSCAoZiksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIEZSQU1FX1BJWEVMX0hFSUdIVCAoZikpOwotICAgICAgICAgIGNyID0gY2Fpcm9fY3JlYXRl IChzdXJmYWNlKTsKLSAgICAgICAgICBjYWlyb19zdXJmYWNlX2Rlc3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k7CisJfQogICAgICAgZWxz ZQogI2VuZGlmCi0gICAgICAgIHsKLSAgICAgICAgICB3aWR0aCA9IEZSQU1FX1BJWEVMX1dJRFRI IChmKTsKLSAgICAgICAgICBoZWlnaHQgPSBGUkFNRV9QSVhFTF9IRUlHSFQgKGYpOwotICAgICAg ICAgIGlmICghIEZSQU1FX0VYVEVSTkFMX1RPT0xfQkFSIChmKSkKLSAgICAgICAgICAgIGhlaWdo dCArPSBGUkFNRV9UT09MX0JBUl9IRUlHSFQgKGYpOwotICAgICAgICAgIGlmICghIEZSQU1FX0VY VEVSTkFMX01FTlVfQkFSIChmKSkKLSAgICAgICAgICAgIGhlaWdodCArPSBGUkFNRV9NRU5VX0JB Ul9IRUlHSFQgKGYpOwotICAgICAgICB9CisJeworCSAgd2lkdGggPSBGUkFNRV9QSVhFTF9XSURU SCAoZik7CisJICBoZWlnaHQgPSBGUkFNRV9QSVhFTF9IRUlHSFQgKGYpOworCSAgaWYgKCEgRlJB TUVfRVhURVJOQUxfVE9PTF9CQVIgKGYpKQorCSAgICBoZWlnaHQgKz0gRlJBTUVfVE9PTF9CQVJf SEVJR0hUIChmKTsKKwkgIGlmICghIEZSQU1FX0VYVEVSTkFMX01FTlVfQkFSIChmKSkKKwkgICAg aGVpZ2h0ICs9IEZSQU1FX01FTlVfQkFSX0hFSUdIVCAoZik7CisJfQogCiAgICAgICBpZiAod2lk dGggPiAwICYmIGhlaWdodCA+IDApCi0gICAgICAgIHsKLSAgICAgICAgICBibG9ja19pbnB1dCgp OwotICAgICAgICAgIEZSQU1FX0NSX1NVUkZBQ0UgKGYpID0gY2Fpcm9faW1hZ2Vfc3VyZmFjZV9j cmVhdGUKLSAgICAgICAgICAgIChDQUlST19GT1JNQVRfQVJHQjMyLCB3aWR0aCwgaGVpZ2h0KTsK LSAgICAgICAgICB1bmJsb2NrX2lucHV0KCk7Ci0gICAgICAgIH0KKwl7CisJICBibG9ja19pbnB1 dCgpOworCSAgRlJBTUVfQ1JfU1VSRk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IChm KSkKLSAgICAgICAgICAgIGhlaWdodCArPSBGUkFNRV9NRU5VX0JBUl9IRUlHSFQgKGYpOwotICAg ICAgICAgIHN1cmZhY2UgPSBjYWlyb194bGliX3N1cmZhY2VfY3JlYXRlIChGUkFNRV9YX0RJU1BM QVkgKGYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBG UkFNRV9YX0RSQVdBQkxFIChmKSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgRlJBTUVfRElTUExBWV9JTkZPIChmKS0+dmlzdWFsLAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB3aWR0aCwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaGVpZ2h0KTsKLSAgICAgICAgICBjciA9 IGNhaXJvX2NyZWF0ZSAoc3VyZmFjZSk7Ci0gICAgICAgICAgY2Fpcm9fc3VyZmFjZV9kZXN0cm95 IChzdXJmYWNlKTsKLSAgICAgICAgfQorCXsKKwkgIGNhaXJvX3N1cmZhY2VfdCAqc3VyZmFjZTsK KwkgIGludCB3aWR0aCA9IEZSQU1FX1BJWEVMX1dJRFRIIChmKTsKKwkgIGludCBoZWlnaHQgPSBG UkFNRV9QSVhFTF9IRUlHSFQgKGYpOworCSAgaWYgKCEgRlJBTUVfRVhURVJOQUxfVE9PTF9CQVIg KGYpKQorCSAgICBoZWlnaHQgKz0gRlJBTUVfVE9PTF9CQVJfSEVJR0hUIChmKTsKKwkgIGlmICgh IEZSQU1FX0VYVEVSTkFMX01FTlVfQkFSIChmKSkKKwkgICAgaGVpZ2h0ICs9IEZSQU1FX01FTlVf QkFSX0hFSUdIVCAoZik7CisJICBzdXJmYWNlID0gY2Fpcm9feGxpYl9zdXJmYWNlX2NyZWF0ZSAo RlJBTUVfWF9ESVNQTEFZIChmKSwKKwkJCQkJICAgICAgIEZSQU1FX1hfRFJBV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Bz dGF0aWMgdm9pZCB4X2RyYXdfaW1hZ2VfZm9yZWdyb3VuZCAoc3RydWN0IGdseXBoX3N0cmluZyAq KTsKIHN0YXRpYyB2b2lkIHhfZHJhd19pbWFnZV9mb3JlZ3JvdW5kXzEgKHN0cnVjdCBnbHlwaF9z dHJpbmcgKiwgUGl4bWFwKTsKIHN0YXRpYyB2b2lkIHhfY2xlYXJfZ2x5cGhfc3RyaW5nX3JlY3Qg KHN0cnVjdCBnbHlwaF9zdHJpbmcgKiwgaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgaW50LCBpbnQsIGludCk7CisJCQkJICAgICAgIGludCwgaW50LCBpbnQpOwog c3RhdGljIHZvaWQgeF9kcmF3X3JlbGllZl9yZWN0IChzdHJ1Y3QgZnJhbWUgKiwgaW50LCBpbnQs IGludCwgaW50LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQsIGJvb2wsIGJv b2wsIGJvb2wsIGJvb2wsIGJvb2wsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhS ZWN0YW5nbGUgKik7CisJCQkJaW50LCBib29sLCBib29sLCBib29sLCBib29sLCBib29sLAorCQkJ CVhSZWN0YW5nbGUgKik7CiBzdGF0aWMgdm9pZCB4X2RyYXdfYm94X3JlY3QgKHN0cnVjdCBnbHlw aF9zdHJpbmcgKiwgaW50LCBpbnQsIGludCwgaW50LAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBpbnQsIGJvb2wsIGJvb2wsIFhSZWN0YW5nbGUgKik7CisJCQkgICAgIGludCwgYm9vbCwg Ym9vbCwgWFJlY3RhbmdsZSAqKTsKIHN0YXRpYyB2b2lkIHhfc2Nyb2xsX2Jhcl9jbGVhciAoc3Ry dWN0IGZyYW1lICopOwogCiAjaWZkZWYgR0xZUEhfREVCVUcKQEAgLTE1MzgsNyArMTUzOCw3IEBA IHhfc2V0X2N1cnNvcl9nYyAoc3RydWN0IGdseXBoX3N0cm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WFRfQVJFQSk7CiAKICAg ICAgIC8qIERvbid0IGRyYXcgaW50byBsZWZ0IG1hcmdpbiwgZnJpbmdlIG9yIHNjcm9sbGJhciBh cmVhCi0gICAgICAgICBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICAqLwor CSBleGNlcHQgZm9yIGhlYWRlciBsaW5lIGFuZCBtb2RlIGxpbmUuICAqLwogICAgICAgaWYgKHgg PCBsZWZ0X3ggJiYgIXMtPnJvdy0+bW9kZV9saW5lX3ApCiAJewogCSAgYmFja2dyb3VuZF93aWR0 aCAtPSBsZWZ0X3ggLSB4OwpAQCAtMzQzNCwxMCArMzQzNCwxMCBAQCB4X2RyYXdfc3RyZXRjaF9n bHlwaF9zdHJpbmcgKHN0cnVjdCBnbHlwaF9zdHJpbmcgKnMpCiAvKgogICAgRHJhdyBhIHdhdnkg bGluZSB1bmRlciBTLiBUaGUgd2F2ZSBmaWxscyB3YXZlX2hlaWdodCBwaXhlbHMgZnJvbSB5MC4K IAotICAgICAgICAgICAgICAgICAgICB4MCAgICAgICAgIHdhdmVfbGVuZ3RoID0gMgotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgLS0KLSAgICAgICAgICAgICAgICB5MCAgICogICAq ICAgKiAgICogICAqCi0gICAgICAgICAgICAgICAgICAgICB8KiAqICogKiAqICogKiAqICoKKwkJ ICAgIHgwICAgICAgICAgd2F2ZV9sZW5ndGggPSAyCisJCQkJIC0tCisJCXkwICAgKiAgICogICAq ICAgKiAgICoKKwkJICAgICB8KiAqICogKiAqICogKiAqICoKICAgICB3YXZlX2hlaWdodCA9IDMg IHwgKiAgICogICAqICAgKgogCiAqLwpAQCAtMzYwOCw4NCArMzYwOCw4NCBAQCB4X2RyYXdfZ2x5 cGhfc3RyaW5nIChzdHJ1Y3QgZ2x5cGhfc3RyaW5nICpzKQogICAgIHsKICAgICAgIC8qIERyYXcg dW5kZXJsaW5lLiAgKi8KICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfcCkKLSAgICAgICAg ewotICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VOREVSX1dB VkUpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVf ZGVmYXVsdGVkX3ApCi0gICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7Ci0gICAg ICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBYR0NW YWx1ZXMgeGdjdjsKLSAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwg cy0+Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOwotICAgICAgICAgICAgICAgICAgWFNldEZvcmVn cm91bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOwotICAg ICAgICAgICAgICAgICAgeF9kcmF3X3VuZGVyd2F2ZSAocyk7Ci0gICAgICAgICAgICAgICAgICBY U2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9yZWdyb3VuZCk7Ci0gICAg ICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKHMtPmZhY2Ut PnVuZGVybGluZV90eXBlID09IEZBQ0VfVU5ERVJfTElORSkKLSAgICAgICAgICAgIHsKLSAgICAg ICAgICAgICAgdW5zaWduZWQgbG9uZyB0aGlja25lc3MsIHBvc2l0aW9uOwotICAgICAgICAgICAg ICBpbnQgeTsKLQotICAgICAgICAgICAgICBpZiAocy0+cHJldiAmJiBzLT5wcmV2LT5mYWNlLT51 bmRlcmxpbmVfcAorCXsKKwkgIGlmIChzLT5mYWNlLT51bmRlcmxpbmVfdHlwZSA9PSBGQUNFX1VO REVSX1dBVkUpCisJICAgIHsKKwkg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ICAgICAg ICAgewotICAgICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgdGhpY2tuZXNzLiAg RGVmYXVsdCBpcyAxIHBpeGVsLiAgKi8KLSAgICAgICAgICAgICAgICAgIGlmIChzLT5mb250ICYm IHMtPmZvbnQtPnVuZGVybGluZV90aGlja25lc3MgPiAwKQotICAgICAgICAgICAgICAgICAgICB0 aGlja25lc3MgPSBzLT5mb250LT51bmRlcmxpbmVfdGhpY2tuZXNzOwotICAgICAgICAgICAgICAg ICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAxOwotICAgICAgICAgICAg ICAgICAgaWYgKHhfdW5kZXJsaW5lX2F0X2Rlc2NlbnRfbGluZSkKLSAgICAgICAgICAgICAgICAg ICAgcG9zaXRpb24gPSAocy0+aGVpZ2h0IC0gdGhpY2tuZXNzKSAtIChzLT55YmFzZSAtIHMtPnkp OwotICAgICAgICAgICAgICAgICAgZWxzZQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAg ICAgICAgICAgICAgICAgLyogR2V0IHRoZSB1bmRlcmxpbmUgcG9zaXRpb24uICBUaGlzIGlzIHRo ZSByZWNvbW1lbmRlZAotICAgICAgICAgICAgICAgICAgICAgICAgIHZlcnRpY2FsIG9mZnNldCBp biBwaXhlbHMgZnJvbSB0aGUgYmFzZWxpbmUgdG8gdGhlIHRvcCBvZgotICAgICAgICAgICAgICAg ICAgICAgICAgIHRoZSB1bmRlcmxpbmUuICBUaGlzIGlzIGEgc2lnbmVkIHZhbHVlIGFjY29yZGlu ZyB0byB0aGUKLSAgICAgICAgICAgICAgICAgICAgICAgICBzcGVjcywgYW5kIGl0cyBkZWZhdWx0 IGlzCi0KLSAgICAgICAgICAgICAgICAgICAgICAgICBST1VORCAoKG1heGltdW0gZGVzY2VudCkg LyAyKSwgd2l0aAotICAgICAgICAgICAgICAgICAgICAgICAgIFJPVU5EKHgpID0gZmxvb3IgKHgg KyAwLjUpICAqLwotCi0gICAgICAgICAgICAgICAgICAgICAgaWYgKHhfdXNlX3VuZGVybGluZV9w b3NpdGlvbl9wcm9wZXJ0aWVzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICYmIHMtPmZvbnQg JiYgcy0+Zm9udC0+dW5kZXJsaW5lX3Bvc2l0aW9uID49IDApCi0gICAgICAgICAgICAgICAgICAg ICAgICBwb3NpdGlvbiA9IHMtPmZvbnQtPnVuZGVybGluZV9wb3NpdGlvbjsKLSAgICAgICAgICAg ICAgICAgICAgICBlbHNlIGlmIChzLT5mb250KQotICAgICAgICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSAocy0+Zm9udC0+ZGVzY2VudCArIDEpIC8gMjsKLSAgICAgICAgICAgICAgICAgICAg ICBlbHNlCi0gICAgICAgICAgICAgICAgICAgICAgICBwb3NpdGlvbiA9IHVuZGVybGluZV9taW5p bXVtX29mZnNldDsKLSAgICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgICAgcG9z aXRpb24gPSBtYXggKHBvc2l0aW9uLCB1bmRlcmxpbmVfbWluaW11bV9vZmZzZXQpOwotICAgICAg ICAgICAgICAgIH0KLSAgICAgICAgICAgICAgLyogQ2hlY2sgdGhlIHNhbml0eSBvZiB0aGlja25l c3MgYW5kIHBvc2l0aW9uLiAgV2Ugc2hvdWxkCi0gICAgICAgICAgICAgICAgIGF2b2lkIGRyYXdp bmcgdW5kZXJsaW5lIG91dCBvZiB0aGUgY3VycmVudCBsaW5lIGFyZWEuICAqLwotICAgICAgICAg ICAgICBpZiAocy0+eSArIHMtPmhlaWdodCA8PSBzLT55YmFzZSArIHBvc2l0aW9uKQotICAgICAg ICAgICAgICAgIHBvc2l0aW9uID0gKHMtPmhlaWdodCAtIDEpIC0gKHMtPnliYXNlIC0gcy0+eSk7 Ci0gICAgICAgICAgICAgIGlmIChzLT55ICsgcy0+aGVpZ2h0IDwgcy0+eWJhc2UgKyBwb3NpdGlv biArIHRoaWNrbmVzcykKLSAgICAgICAgICAgICAgICB0aGlja25lc3MgPSAocy0+eSArIHMtPmhl aWdodCkgLSAocy0+eWJhc2UgKyBwb3NpdGlvbik7Ci0gICAgICAgICAgICAgIHMtPnVuZGVybGlu ZV90aGlja25lc3MgPSB0aGlja25lc3M7Ci0gICAgICAgICAgICAgIHMtPnVuZGVybGluZV9wb3Np dGlvbiA9IHBvc2l0aW9uOwotICAgICAgICAgICAgICB5ID0gcy0+eWJhc2UgKyBwb3NpdGlvbjsK LSAgICAgICAgICAgICAgaWYgKHMtPmZhY2UtPnVuZGVybGluZV9kZWZhdWx0ZWRfcCkKLSAgICAg ICAgICAgICAgICB4X2ZpbGxfcmVjdGFuZ2xlIChzLT5mLCBzLT5nYywKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7Ci0gICAgICAg ICAgICAgIGVsc2UKLSAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICBYR0NWYWx1 ZXMgeGdjdjsKLSAgICAgICAgICAgICAgICAgIFhHZXRHQ1ZhbHVlcyAocy0+ZGlzcGxheSwgcy0+ Z2MsIEdDRm9yZWdyb3VuZCwgJnhnY3YpOwotICAgICAgICAgICAgICAgICAgWFNldEZvcmVncm91 bmQgKHMtPmRpc3BsYXksIHMtPmdjLCBzLT5mYWNlLT51bmRlcmxpbmVfY29sb3IpOwotICAgICAg ICAgICAgICAgICAgeF9maWxsX3JlY3RhbmdsZSAocy0+Ziwgcy0+Z2MsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgcy0+eCwgeSwgcy0+d2lkdGgsIHRoaWNrbmVzcyk7Ci0gICAg ICAgICAgICAgICAgICBYU2V0Rm9yZWdyb3VuZCAocy0+ZGlzcGxheSwgcy0+Z2MsIHhnY3YuZm9y ZWdyb3VuZCk7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgfQotICAgICAgICB9CisJ CXsKKwkJICAvKiBXZSB1c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Nfd2luZG93KTsKKwkgWEZsdXNoIChkcHkpOwogICAgICAgIH0KICAgICB9 CiB9CkBAIC0zOTU0LDEwICszOTU0LDEwIEBAIFhUZmxhc2ggKHN0cnVjdCBmcmFtZSAqZikKICAg ICBHZGtHQ1ZhbHVlcyB2YWxzOwogICAgIEdka0dDICpnYzsKICAgICB2YWxzLmZvcmVncm91bmQu cGl4ZWwgPSAoRlJBTUVfRk9SRUdST1VORF9QSVhFTCAoZikKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgXiBGUkFNRV9CQUNLR1JPVU5EX1BJWEVMIChmKSk7CisJCQkgICAgIF4gRlJBTUVf QkFDS0dST1VORF9QSVhFTCAoZikpOwogICAgIHZhbHMuZnVuY3Rpb24gPSBHREtfWE9SOwogICAg IGdjID0gZ2RrX2djX25ld193aXRoX3ZhbHVlcyAod2luZG93LAotICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgJnZhbHMsIEdES19HQ19GVU5DVElPTiB8IEdES19HQ19GT1JFR1JPVU5E KTsKKwkJCQkgJnZhbHMsIEdES19HQ19GVU5DVElPTiB8IEdES19HQ19GT1JFR1JPVU5EKTsKICNk ZWZpbmUgWEZpbGxSZWN0YW5nbGUoZCwgd2luLCBnYywgeCwgeSwgdywgaCkgXAogICAgIGdka19k cmF3X3JlY3RhbmdsZSAod2luZG93LCBnYywgdHJ1ZSwgeCwgeSwgdywgaCkKICNlbmRpZiAvKiAh IEhBVkVfR1RLMyAqLwpAQCAtNDA5Myw3ICs0MDkzLDcgQEAgWFRyaW5nX2JlbGwgKHN0cnVjdCBm cmFtZSAqZikKIAl7CiAJICBibG9ja19pbnB1dCAoKTsKICNpZmRlZiBIQVZFX1hLQgotICAgICAg ICAgIFhrYkJlbGwgKEZSQU1FX1hfRElTUExBWSAoZiksIE5vbmUsIDAsIE5vbmUpOworCSAgWGti QmVsbCAoRlJBTUVfWF9ESVNQTEFZIChmKSwgTm9uZSwgMCwgTm9uZSk7CiAjZWxzZQogC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gdHlwZSkKICAgICAgIExpc3BfT2JqZWN0IGJhciwgY29uZGVtbmVkOwogCiAg ICAgICBpZiAoISBGUkFNRV9YX1AgKFhGUkFNRSAoZnJhbWUpKSkKLSAgICAgICAgY29udGludWU7 CisJY29udGludWU7CiAKICAgICAgIC8qIFNjYW4gdGhpcyBmcmFtZSdzIHNjcm9sbCBiYXIgbGlz dCBmb3IgYSBzY3JvbGwgYmFyIHdpdGggdGhlCi0gICAgICAgICByaWdodCB3aW5kb3cgSUQuICAq LworCSByaWdodCB3aW5kb3cgSUQuICAqLwogICAgICAgY29uZGVtbmVkID0gRlJBTUVfQ09OREVN TkVEX1NDUk9MTF9CQVJTIChYRlJBTUUgKGZyYW1lKSk7CiAgICAgICBmb3IgKGJhciA9IEZSQU1F X1NDUk9MTF9CQVJTIChYRlJBTUUgKGZyYW1lKSk7CiAJICAgLyogVGhpcyB0cmljayBhbGxvd3Mg dXMgdG8gc2VhcmNoIGJvdGggdGhlIG9yZGluYXJ5IGFuZAotICAgICAgICAgICAgICBjb25kZW1u ZWQgc2Nyb2xsIGJhciBsaXN0cyB3aXRoIG9uZSBsb29wLiAgKi8KKwkgICAgICBjb25kZW1uZWQg c2Nyb2xsIGJhciBsaXN0cyB3aXRoIG9uZSBsb29wLiAgKi8KIAkgICAhIE5JTFAgKGJhcikgfHwg KGJhciA9IGNvbmRlbW5lZCwKIAkJCSAgICAgICBjb25kZW1uZWQgPSBRbmlsLAogCQkJICAgICAg ICEgTklMUCAoYmFyKSk7CiAJICAgYmFyID0gWFNDUk9MTF9CQVIgKGJhciktPm5leHQpCiAJaWYg KFhTQ1JPTExfQkFSIChiYXIpLT54X3dpbmRvdyA9PSB3aW5kb3dfaWQKLSAgICAgICAgICAgICYm IEZSQU1FX1hfRElTUExBWSAoWEZSQU1FIChmcmFtZSkpID09IGRpc3BsYXkKKwkgICAgJiYgRlJB TUVfWF9ESVNQTEFZIChYRlJBTUUgKGZyYW1lKSkgPT0gZGlzcGxheQogCSAgICAm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sK KwkgIGlmICgheF9hbGxvY19saWdodGVyX2NvbG9yIChmLCBGUkFNRV9YX0RJU1BMQVkgKGYpLAor CQkJCSAgICAgIEZSQU1FX1hfQ09MT1JNQVAgKGYpLAorCQkJCSAgICAgICZwaXhlbCwgMS4yLCAw eDgwMDApKQorCSAgICBwaXhlbCA9IC0xOworCSAgZi0+b3V0cHV0X2RhdGEueC0+c2Nyb2xsX2Jh cl90b3Bfc2hhZG93X3BpeGVsID0gcGl4ZWw7CisJfQogICAgIH0KICAgaWYgKGYtPm91dHB1dF9k YXRhLngtPnNjcm9sbF9iYXJfYm90dG9tX3NoYWRvd19waXhlbCA9PSAtMSkKICAgICB7CiAgICAg ICBwaXhlbCA9IGYtPm91dHB1dF9kYXRhLngtPnNjcm9sbF9iYXJfYmFja2dyb3VuZF9waXhlbDsK ICAgICAgIGlmIChwaXhlbCAhPSAtMSkKLSAgICAgICAgewotICAgICAgICAgIGlmICgheF9hbGxv Y19saWdodGVyX2NvbG9yIChmLCBGUkFNRV9YX0RJU1BMQVkgKGYpLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBGUkFNRV9YX0NPTE9STUFQIChmKSwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgJnBpeGVsLCAwLjYsIDB4NDAwMCkpCi0gICAgICAg ICAgICBwaXhlbCA9IC0xOwotICAgICAgICAgIGYtPm91dHB1dF9kYXRhLngtPnNjcm9sbF9iYXJf Ym90dG9tX3NoYWRvd19waXhlbCA9IHBpeGVsOwotICAgICAgICB9CisJeworCSAgaWYgKCF4X2Fs bG9jX2xpZ2h0ZXJfY29sb3IgKGYsIEZSQU1FX1hfRElTUExBWSAoZiksCisJCQkJICAgICAgRlJB TUVfWF9DT0xPUk1BUCAoZiksCisJCQkJICAgICAgJnBpeGVsLCAwLjYsIDB4NDAwMCkpCisJICAg IHBpeGVsID0gLTE7CisJICBmLT5vdXRwdXRfZGF0YS54LT5zY3JvbGxfYmFyX2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mZvcm1hdCA9PSAzMikKLSAgICAgICAg ICB7Ci0gICAgICAgICAgICBpZiAoZXZlbnQtPnhjbGllbnQuZGF0YS5sWzBdID09IGRweWluZm8t PlhhdG9tX3dtX3Rha2VfZm9jdXMpCi0gICAgICAgICAgICAgIHsKLSAgICAgICAgICAgICAgICAv KiBVc2UgdGhlIHZhbHVlIHJldHVybmVkIGJ5IHhfYW55X3dpbmRvd190b19mcmFtZQorCWlmIChl dmVudC0+eGNsaWVudC5tZXNzYWdlX3R5cGUgPT0gZHB5aW5mby0+WGF0b21fd21fcHJvdG9jb2xz CisJICAgICYmIGV2ZW50LT54Y2xpZW50LmZvcm1hdCA9PSAzMikKKwkgIHsKKwkgICAgaWYgKGV2 ZW50LT54Y2xpZW50LmRhdGEubFswXSA9PSBkcHlpbmZvLT5YYXRvbV93bV90YWtlX2ZvY3VzKQor CSAgICAgIHsKKwkJLyogVXNlIHRoZSB2YWx1ZSByZXR1cm5lZCBieSB4X2FueV93aW5kb3dfdG9f ZnJhbWUKIAkJICAgYmVjYXVzZSB0aGlzIGNvdWxkIGJlIHRoZSBzaGVsbCB3aWRnZXQgd2luZG93 CiAJCSAgIGlmIHRoZSBmcmFtZSBoYXMgbm8gdGl0bGUgYmFyLiAgKi8KLSAgICAgICAgICAgICAg ICBmID0gYW55OworCQlmID0gYW55OwogI2lmZGVmIEhBVkVfWF9JMThOCi0gICAgICAgICAgICAg ICAgLyogTm90IHF1aXRlIHN1cmUgdGhpcyBpcyBuZWVkZWQgLXBkICovCi0gICAgICAgICAgICAg ICAgaWYgKGYgJiYgRlJBTUVfWElDIChmKSkKLSAgICAgICAgICAgICAgICAgIFhTZXRJQ0ZvY3Vz IChGUkFNRV9YSUMgKGYpKTsKKwkJLyogTm90IHF1aXRlIHN1cmUgdGhpcyBpcyBuZWVkZWQgLXBk ICovCisJCWlmIChmICYmIEZSQU1FX1hJQyAoZikpCisJCSAgWFNldElDRm9jdXMgKEZSQU1FX1hJ QyAoZikpOwogI2VuZGlmCiAjaWYgZmFsc2UKICAgICAgIC8qIEVtYWNzIHNldHMgV00gaGludHMg d2hvc2UgYGlucHV0JyBmaWVsZCBpcyBgdHJ1ZScuICBUaGlzCkBAIC03NjAxLDE0NiArNzYwMSwx NDYgQEAgaGFuZGxlX29uZV94ZXZlbnQgKHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbywK IAkgYmVsb3cgY2FuIGdlbmVyYXRlIGFkZGl0aW9uYWwgRm9jdXNJbiBldmVudHMgd2hpY2ggY29u ZnVzZQogCSBFbWFjcy4gICovCiAKLSAgICAgICAgICAgICAgICAvKiBTaW5jZSB3ZSBzZXQgV01f VEFLRV9GT0NVUywgd2UgbXVzdCBjYWxsCi0gICAgICAgICAgICAgICAgICAgWFNldElucHV0Rm9j dXMgZXhwbGljaXRseS4gIEJ1dCBub3QgaWYgZiBpcyBudWxsLAotICAgICAgICAgICAgICAgICAg IHNpbmNlIHRoYXQgbWlnaHQgYmUgYW4gZXZlbnQgZm9yIGEgZGVsZXRlZCBmcmFtZS4gICovCi0g ICAgICAgICAgICAgICAgaWYgKGYpCi0gICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAg ICAgICAgIERpc3BsYXkgKmQgPSBldmVudC0+eGNsaWVudC5kaXNwbGF5OwotICAgICAgICAgICAg ICAgICAgICAvKiBDYXRjaCBhbmQgaWdub3JlIGVycm9ycywgaW4gY2FzZSB3aW5kb3cgaGFzIGJl ZW4KLSAgICAgICAgICAgICAgICAgICAgICAgaWNvbmlmaWVkIGJ5IGEgd2luZG93IG1hbmFnZXIg c3VjaCBhcyBHV00uICAqLwotICAgICAgICAgICAgICAgICAgICB4X2NhdGNoX2Vycm9ycyAoZCk7 Ci0gICAgICAgICAgICAgICAgICAgIFhTZXRJbnB1dEZvY3VzIChkLCBldmVudC0+eGNsaWVudC53 aW5kb3csCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAvKiBUaGUgSUNDQ00g c2F5cyB0aGlzIGlzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0aGUg b25seSB2YWxpZCBjaG9pY2UuICAqLwotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgUmV2ZXJ0VG9QYXJlbnQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBl dmVudC0+eGNsaWVudC5kYXRhLmxbMV0pOwotICAgICAgICAgICAgICAgICAgICB4X3VuY2F0Y2hf ZXJyb3JzICgpOwotICAgICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAgIC8qIE5vdCBj ZXJ0YWluIGFib3V0IGhhbmRsaW5nIHNjcm9sbCBiYXJzIGhlcmUgKi8KKwkJLyogU2luY2Ugd2Ug c2V0IFdNX1RBS0VfRk9DVVMsIHdlIG11c3QgY2FsbAorCQkgICBYU2V0SW5wdXRGb2N1cyBleHBs aWNpdGx5LiAgQnV0IG5vdCBpZiBmIGlzIG51bGwsCisJCSAgIHNpbmNlIHRoYXQgbWlnaHQgYmUg YW4gZXZlbnQgZm9yIGEgZGVsZXRlZCBmcmFtZS4gICovCisJCWlmIChmKQorCQkgIHsKKwkJICAg IERpc3BsYXkgKmQgPSBldmVudC0+eGNsaWVudC5kaXNwbGF5OworCQkgICAgLyogQ2F0Y2ggYW5k IGlnbm9yZSBlcnJvcnMsIGluIGNhc2Ugd2luZG93IGhhcyBiZWVuCisJCSAgICAgICBpY29uaWZp ZWQgYnkgYSB3aW5kb3cgbWFuYWdlciBzdWNoIGFzIEdXTS4gICovCisJCSAgICB4X2NhdGNoX2Vy cm9ycyAoZCk7CisJCSAgICBYU2V0SW5wdXRGb2N1cyAoZCwgZXZlbnQtPnhjbGllbnQud2luZG93 LAorCQkJCSAgICAvKiBUaGUgSUNDQ00gc2F5cyB0aGlzIGlzCisJCQkJICAgICAgIHRoZSBvbmx5 IHZhbGlkIGNob2ljZS4gICovCisJCQkJICAgIFJldmVydFRvUGFyZW50LAorCQkJCSAgICBldmV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gICAgICAgICAgICAgICAgWFNldENvbW1hbmQgKEZSQU1FX1hfRElTUExBWSAoZiks Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LT54Y2xpZW50LndpbmRv dywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW5pdGlhbF9hcmd2LCBpbml0 aWFsX2FyZ2MpOwotICAgICAgICAgICAgICAgICAgICBlbHNlIGlmIChmKQotICAgICAgICAgICAg ICAgICAgICAgIFhTZXRDb21tYW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLAotICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBldmVudC0+eGNsaWVudC53aW5kb3csCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDAsIDApOwotICAgICAgICAgICAgICAgICAgfQorCQlp ZiAoISB4X3Nlc3Npb25faGF2ZV9jb25uZWN0aW9uICgpKQorI2VuZGlmCisJCSAgeworCQkgICAg ZiA9IHhfdG9wX3dpbmRvd190b19mcmFtZSAoZHB5aW5mbywKKwkJCQkJICAgICAgIGV2ZW50LT54 Y2xpZW50LndpbmRvdyk7CisJCSAgICAvKiBUaGlzIGlzIGp1c3Qgc28gd2Ugb25seSBnaXZlIHJl YWwgZGF0YSBvbmNlCisJCSAgICAgICBmb3IgYSBzaW5nbGUgRW1hY3MgcHJvY2Vzcy4gICovCisJ CSAgICBpZiAoZiA9PSBTRUxFQ1RFRF9GUkFNRSAoKSkKKwkJICAgICAgWFNldENvbW1hbmQgKEZS QU1FX1hfRElTUExBWSAoZiksCisJCQkJICAgZXZlbnQtPnhjbGllbnQud2luZG93LAorCQkJCSAg IGluaXRpYWxfYXJndiwgaW5pdGlhbF9hcmdjKTsKKwkJICAgIGVsc2UgaWYgKGYpCisJCSAgICAg IFhTZXRDb21tYW5kIChGUkFNRV9YX0RJU1BMQVkgKGYpLAorCQkJCSAgIGV2ZW50LT54Y2xpZW50 LndpbmRvdywKKwkJCQkgICAwLCAwKTsKKwkJICB9CiAJCWdvdG8gZG9uZTsKLSAgICAgICAgICAg ICAgfQorCSAgICAgIH0KIAotICAgICAgICAgICAgaWYgKGV2ZW50LT54Y2xpZW50LmRhdGEubFsw XSA9PSBkcHlpbmZvLT5YYXRvbV93bV9kZWxldGVfd2luZG93KQotICAgICAgICAgICAgICB7Ci0g ICAgICAgICAgICAgICAgZiA9IGFueTsKLSAgICAgICAgICAgICAgICBpZiAoIWYpCisJICAgIGlm IChldmVudC0+eGNsaWVudC5kYXRhLmxbMF0gPT0gZHB5aW5mby0+WGF0b21fd21fZGVsZXRlX3dp bmRvdykKKwkgICAgICB7CisJCWYgPSBhbnk7CisJCWlmICghZikKIAkJICBnb3RvIE9USEVSOyAv KiBNYXkgYmUgYSBkaWFsb2cgdGhhdCBpcyB0byBiZSByZW1vdmVkICAqLwogCiAJCWluZXYuaWUu a2luZCA9IERFTEVURV9XSU5ET1dfRVZFTlQ7CiAJCVhTRVRGUkFNRSAoaW5ldi5pZS5mcmFtZV9v cl93aW5kb3csIGYpOwogCQlnb3RvIGRvbmU7Ci0gICAgICAgICAgICAgIH0KKwkgICAgICB9CiAK IAkgICAgZ290byBkb25lOwotICAgICAgICAgIH0KKwkgIH0KIAotICAgICAgICBpZiAoZXZlbnQt PnhjbGllbnQubWVzc2FnZV90eXBlID09IGRweWluZm8tPlhhdG9tX3dtX2NvbmZpZ3VyZV9kZW5p ZWQpCisJaWYgKGV2ZW50LT54Y2xpZW50Lm1lc3NhZ2VfdHlwZSA9PSBkcHlpbmZvLT5YYXRvbV93 bV9jb25maWd1cmVfZGVuaWVkKQogCSAgZ290byBkb25lOwogCi0gICAgICAgIGlmIChldmVudC0+ eGNsaWVudC5tZXNzYWdlX3R5cGUgPT0gZHB5aW5mby0+WGF0b21fd21fd2luZG93X21vdmVkKQot ICAgICAgICAgIHsKLSAgICAgICAgICAgIGludCBuZXdfeCwgbmV3X3k7CisJaWYgKGV2ZW50LT54 Y2xpZW50Lm1lc3NhZ2VfdHlwZSA9PSBkcHlpbmZvLT5YYXRvbV93bV93aW5kb3dfbW92ZWQpCisJ ICB7CisJICAgIGludCBuZXdfeCwgbmV3X3k7CiAJICAgIGYgPSB4X3dpbmRvd190b19mcmFtZSAo ZHB5aW5mbywgZXZlbnQtPnhjbGllbnQud2luZG93KTsKIAotICAgICAgICAgICAgbmV3X3ggPSBl dmVudC0+eGNsaWVudC5kYXRhLnNbMF07Ci0gICAgICAgICAgICBuZXdfeSA9IGV2ZW50LT54Y2xp ZW50LmRhdGEuc1sxXTsKKwkgICAgbmV3X3ggPSBldmVudC0+eGNsaWVudC5kYXRhLnNbMF07CisJ ICAgIG5ld195ID0gZXZlbnQtPnhjbGllbnQuZGF0YS5zWzFdOwogCi0gICAgICAgICAgICBpZiAo ZikKLSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIGYtPmxlZnRfcG9zID0gbmV3X3g7 Ci0gICAgICAgICAgICAgICAgZi0+dG9wX3BvcyA9IG5ld195OwotICAgICAgICAgICAgICB9CisJ ICAgIGlmIChmKQorCSAgICAgIHsKKwkJZi0+bGVmdF9wb3MgPSBuZXdfeDsKKwkJZi0+dG9wX3Bv cyA9IG5ld195OworCSAgICAgIH0KIAkgICAgZ290byBkb25lOwotICAgICAgICAgIH0KKwkgIH0K IAogI2lmZGVmIFhfVE9PTEtJVF9FRElUUkVTCi0gICAgICAgIGlmIChldmVudC0+eGNsaWVudC5t ZXNzYWdlX3R5cGUgPT0gZHB5aW5mby0+WGF0b21fZWRpdHJlcykKLSAgICAgICAgICB7CisJaWYg KGV2ZW50LT54Y2xpZW50Lm1lc3NhZ2VfdHlwZSA9PSBkcHlpbmZvLT5YYXRvbV9lZGl0cmVzKQor CSAgewogCSAgICBmID0gYW55OwogCSAgICBpZiAoZikKLSAgICAgICAgICAgICAgX1hFZGl0UmVz Q2hlY2tNZXNzYWdlcyAoZi0+b3V0cHV0X2RhdGEueC0+d2lkZ2V0LAorCSAgICAgIF9YRWRpdFJl c0NoZW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XBlID0gWF9XTVRZUEVfVU5LTk9XTjsKKwkgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZiktPm5l dF9zdXBwb3J0ZWRfd2luZG93ID0gMDsKIAotICAgICAgICAgIHhfc2V0X2ZyYW1lX2FscGhhIChm KTsKLSAgICAgICAgfQorCSAgeF9zZXRfZnJhbWVfYWxwaGEgKGYpOworCX0KICAgICAgIGdvdG8g T1RIRVI7CiAKICAgICBjYXNlIEV4cG9zZToKICAgICAgIGYgPSB4X3dpbmRvd190b19mcmFtZSAo ZHB5aW5mbywgZXZlbnQtPnhleHBvc2Uud2luZG93KTsKICAgICAgIGlmIChmKQotICAgICAgICB7 Ci0gICAgICAgICAgaWYgKCFGUkFNRV9WSVNJQkxFX1AgKGYpKQotICAgICAgICAgICAgewotICAg ICAgICAgICAgICBibG9ja19pbnB1dCAoKTsKLSAgICAgICAgICAgICAgU0VUX0ZSQU1FX1ZJU0lC TEUgKGYsIDEpOwotICAgICAgICAgICAgICBTRVRfRlJBTUVfSUNPTklGSUVEIChmLCBmYWxzZSk7 Ci0gICAgICAgICAgICAgIGlmIChGUkFNRV9YX0RPVUJMRV9CVUZGRVJFRF9QIChmKSkKLSAgICAg ICAgICAgICAgICBmb250X2Ryb3BfeHJlbmRlcl9zdXJmYWNlcyAoZik7Ci0gICAgICAgICAgICAg IGYtPm91dHB1dF9kYXRhLngtPmhhc19iZWVuX3Zpc2libGUgPSB0cnVlOwotICAgICAgICAgICAg ICBTRVRfRlJBTUVfR0FSQkFHRUQgKGYpOwotICAgICAgICAgICAgICB1bmJsb2NrX2lucHV0ICgp OwotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKEZSQU1FX0dBUkJBR0VEX1AgKGYp KQotICAgICAgICAgICAgeworCXsKKwkgIGlmICghRlJBTUVfVklTSUJMRV9QIChmKSkKKwkgICAg eworCSAgICAgIGJsb2NrX2lucHV0ICgpOworCSAgICAgIFNFVF9GUkFNRV9WSVNJQkxFIChmLCAx KTsKKwkgICAgICBTRVRfRlJBTUVfSUNPTklGSUVEIChmLCBmYWxzZSk7CisJICAgICAgaWYgKEZS QU1FX1hfRE9VQkxFX0JVRkZFUkVEX1AgKGYpKQorCQlmb250X2Ryb3BfeHJlbmRlcl9zdXJmYWNl cyAoZik7CisJICAgICAgZi0+b3V0cHV0X2RhdGEueC0+aGFzX2JlZW5fdmlzaWJsZSA9IHRydWU7 CisJICAgICAgU0VUX0ZSQU1FX0dBUkJBR0VEIChmKTsKKwkgICAgICB1bmJsb2NrX2lucHV0ICgp OworCSAgICB9CisJICBlbHNlIGlmIChGUkFNRV9HQVJCQUdFRF9QIChmKSkKKwkgICAgewogI2lm ZGVmIFVTRV9HVEsKLSAgICAgICAgICAgICAgLyogR28gYXJvdW5kIHRoZSBiYWNrIGJ1ZmZlciBh bmQgbWFudWFsbHkgY2xlYXIgdGhlCi0gICAgICAgICAgICAgICAgIHdpbmRvdyB0aGUgZmlyc3Qg dGltZSB3ZSBzaG93IGl0LiAgVGhpcyB3YXksIHdlIGF2b2lkCi0gICAgICAgICAgICAgICAgIHNo b3dpbmcgdXNlcnMgdGhlIHNhbml0eS1kZWZ5aW5nIGhvcnJvciBvZiB3aGF0ZXZlcgotICAgICAg ICAgICAgICAgICBHdGtXaW5kb3cgaXMgcmVuZGVyaW5nIGJlbmVhdGggdXMuICBXZSd2ZSBnYXJi YWdlZAotICAgICAgICAgICAgICAgICB0aGUgZnJhbWUsIHNvIHdlJ2xsIHJlZHJhdyB0aGUgd2hv bGUgdGhpbmcgb24gbmV4dAotICAgICAgICAgICAgICAgICByZWRpc3BsYXkgYW55d2F5LiAgWXVj ay4gICovCi0gICAgICAgICAgICAgIHhfY2xlYXJfYXJlYTEgKAotICAgICAgICAgICAgICAgIEZS QU1FX1hfRElTUExBWSAoZiksCi0gICAgICAgICAgICAgICAgRlJBTUVfWF9XSU5ET1cgKGYpLAot ICAgICAgICAgICAgICAgIGV2ZW50LT54ZXhwb3NlLngsIGV2ZW50LT54ZXh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mdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVnPTE1Mzk4LiAg Ki8KLSAgICAgICAgICAgICAgeF9jbGVhcl9hcmVhIChmLAotICAgICAgICAgICAgICAgICAgICAg ICAgICAgIGV2ZW50LT54ZXhwb3NlLngsIGV2ZW50LT54ZXhwb3NlLnksCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgZXZlbnQtPnhleHBvc2Uud2lkdGgsIGV2ZW50LT54ZXhwb3NlLmhlaWdo dCk7CisJICAgICAgLyogVGhpcyBzZWVtcyB0byBiZSBuZWVkZWQgZm9yIEdUSyAyLjYgYW5kIGxh dGVyLCBzZWUKKwkJIGh0dHA6Ly9kZWJidWdzLmdudS5vcmcvY2dpL2J1Z3JlcG9ydC5jZ2k/YnVn PTE1Mzk4LiAgKi8KKwkgICAgICB4X2NsZWFyX2FyZWEgKGYsCisJCQkgICAgZXZlbnQtPnhleHBv c2UueCwgZXZlbnQtPnhleHBvc2UueSwKKwkJCSAgICBldmVudC0+eGV4cG9zZS53aWR0aCwgZXZl bnQtPnhleHBvc2UuaGVpZ2h0KTsKICNlbmRpZgotICAgICAgICAgICAgICBleHBvc2VfZnJhbWUg KGYsIGV2ZW50LT54ZXhwb3NlLngsIGV2ZW50LT54ZXhwb3NlLnksCisJICAgICAgZXhwb3NlX2Zy YW1lIChmLCBldmVudC0+eGV4cG9zZS54LCBldmVudC0+eGV4cG9zZS55LAogCQkJICAgIGV2ZW50 LT54ZXhwb3NlLndpZHRoLCBldmVudC0+eGV4cG9zZS5oZWlnaHQpOwotICAgICAgICAgICAgfQor CSAgICB9CiAKLSAgICAgICAgICBpZiAoIUZSQU1FX0dBUkJBR0VEX1AgKGYpKQotICAgICAgICAg ICAgc2hvd19iYWNrX2J1ZmZlciAoZik7Ci0gICAgICAgIH0KKwkgIGlmICghRlJBTUVfR0FSQkFH RURfUCAoZikpCisJICAgIHNob3dfYmFja19idWZmZXIgKGYpOworCX0KICAgICAgIGVsc2UKLSAg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TQ1JPTExfQkFSUwotICAgICAgICAg IC8qIERpc3BhdGNoIGV2ZW50IHRvIHRoZSB3aWRnZXQuICAqLwotICAgICAgICAgIGdvdG8gT1RI RVI7CisJICAvKiBEaXNwYXRjaCBldmVudCB0byB0aGUgd2lkZ2V0LiAgKi8KKwkgIGdvdG8gT1RI RVI7CiAjZWxzZSAvKiBub3QgVVNFX1RPT0xLSVRfU0NST0xMX0JBUlMgKi8KLSAgICAgICAgICBi YXIgPSB4X3dpbmRvd190b19zY3JvbGxfYmFyIChldmVudC0+eGV4cG9zZS5kaXNwbGF5LAotICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LT54ZXhwb3NlLndpbmRv dywgMik7CisJICBiYXIgPSB4X3dpbmRvd190b19zY3JvbGxfYmFyIChldmVudC0+eGV4cG9zZS5k aXNwbGF5LAorCQkJCQlldmVudC0+eGV4cG9zZS53aW5kb3csIDIpOwogCi0gICAgICAgICAgaWYg KGJhcikKLSAgICAgICAgICAgIHhfc2Nyb2xsX2Jhcl9leHBvc2UgKGJhciwgZXZlbnQpOworCSAg aWYgKGJhcikKKwkgICAgeF9zY3JvbGxfYmFyX2V4cG9zZSAoYmFyLCBldmVudCk7CiAjaWZkZWYg VVNFX1hfVE9PTEtJVAotICAgICAgICAgIGVsc2UKLSAgICAgICAgICAgIGdvdG8gT1RIRVI7CisJ ICBlbHNlCisJICAgIGdvdG8gT1RIRVI7CiAjZW5kaWYgLyogVVNFX1hfVE9PTEtJVCAqLwogI2Vu ZGlmIC8qIG5vdCBVU0VfVE9PTEtJVF9TQ1JPTExfQkFSUyAqLwotICAgICAgICB9CisJfQogICAg ICAgYnJlYWs7CiAKICAgICBjYXNlIEdyYXBoaWNzRXhwb3NlOgkvKiBUaGlzIG9jY3VycyB3aGVu IGFuIFhDb3B5QXJlYSdzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJj ZSBhcmVhIHdhcyBvYnNjdXJlZCBvciBub3QKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgYXZhaWxhYmxlLiAgKi8KKwkJCQkgICBzb3VyY2UgYXJlYSB3YXMgb2JzY3VyZWQgb3Ig bm90CisJCQkJICAgYXZhaWxhYmxlLiAgKi8KICAgICAgIGYgPSB4X3dpbmRvd190b19mcmFtZSAo ZHB5aW5mbywgZXZlbnQtPnhncmFwaGljc2V4cG9zZS5kcmF3YWJsZSk7CiAgICAgICBpZiAoZikK LSAgICAgICAgewotICAgICAgICAgIGV4cG9zZV9mcmFtZSAoZiwgZXZlbnQtPnhncmFwaGljc2V4 cG9zZS54LAotICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQtPnhncmFwaGljc2V4cG9zZS55 LAotICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQtPnhncmFwaGljc2V4cG9zZS53aWR0aCwK LSAgICAgICAgICAgICAgICAgICAgICAgIGV2ZW50LT54Z3JhcGhpY3NleHBvc2UuaGVpZ2h0KTsK LSAgICAgICAgICBzaG93X2JhY2tfYnVmZmVyIChmKTsKLSAgICAgICAgfQorCXsKKwkgIGV4cG9z ZV9mcmFtZSAoZiwgZXZlbnQtPnhncmFwaGljc2V4cG9zZS54LAorCQkJZXZlbnQtPnhncmFwaGlj c2V4cG9zZS55LAorCQkJZXZlbnQtPnhncmFwaGljc2V4cG9zZS53aWR0aCwKKwkJCWV2ZW50LT54 Z3JhcGhpY3NleHBvc2UuaGVpZ2h0KTsKKwkgIHNob3dfYmFja19idWZmZXIgKGYpOworCX0KICNp ZmRlZiBVU0VfWF9UT09MS0lUCiAgICAgICBlbHNlCi0gICAgICAgIGdvdG8gT1RIRVI7CisJZ290 byBPVEhFUjsKICNlbmRpZiAvKiBVU0VfWF9UT09MS0lUICovCiAgICAgICBicmVhazsKIAogICAg IGNhc2UgTm9FeHBvc2U6CQkvKiBUaGlzIG9jY3VycyB3aGVuIGFuIFhDb3B5QXJlYSdzCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNvdXJjZSBhcmVhIHdhcyBjb21wbGV0ZWx5 Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGF2YWlsYWJsZS4gICovCisJCQkJ ICAgc291cmNlIGFyZWEgd2FzIGNvbXBsZXRlbHkKKwkJCQkgICBhdmFpbGFibGUuICAqLwogICAg ICAgYnJlYWs7CiAKICAgICBjYXNlIFVubWFwTm90aWZ5OgogICAgICAgLyogUmVkbyB0aGUgbW91 c2UtaGlnaGxpZ2h0IGFmdGVyIHRoZSB0b29sdGlwIGhhcyBnb25lLiAgKi8KICAgICAgIGlmIChl dmVudC0+eHVubWFwLndpbmRvdyA9PSB0aXBfd2luZG93KQotICAgICAgICB7Ci0gICAgICAgICAg dGlwX3dpbmRvdyA9IDA7Ci0gICAgICAgICAgeF9yZWRvX21vdXNlX2hpZ2hsaWdodCAoZHB5aW5m byk7Ci0gICAgICAgIH0KKwl7CisJICB0aXBfd2luZG93ID0gMDsKKwkgIHhfcmVkb19tb3VzZV9o aWdobGlnaHQgKGRweWluZm8pOworCX0KIAogICAgICAgZiA9IHhfdG9wX3dpbmRvd190b19mcmFt ZSAoZHB5aW5mbywgZXZlbnQtPnh1bm1hcC53aW5kb3cpOwogICAgICAgaWYgKGYpCQkvKiBGIG1h eSBubyBsb25nZXIgZXhpc3QgaWYKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIHRoZSBmcmFt ZSB3YXMgZGVsZXRlZC4gICovCi0gICAgICAgIHsKKwkJCSAgIHRoZSBmcmFtZSB3YXMgZGVsZXRl ZC4gICovCisJewogCSAgYm9vbCB2aXNpYmxlID0gRlJBTUVfVklTSUJMRV9QIChmKTsKLSAgICAg ICAgICAvKiBXaGlsZSBhIGZyYW1lIGlzIHVubWFwcGVkLCBkaXNwbGF5IGdlbmVyYXRpb24gaXMK LSAgICAgICAgICAgICBkaXNhYmxlZDsgeW91IGRvbid0IHdhbnQgdG8gc3BlbmQgdGltZSB1cGRh dGluZyBhCi0gICAgICAgICAgICAgZGlzcGxheSB0aGF0IHdvbid0IGV2ZXIgYmUgc2Vlbi4gICov Ci0gICAgICAgICAgU0VUX0ZSQU1FX1ZJU0lCTEUgKGYsIDApOwotICAgICAgICAgIC8qIFdlIGNh bid0IGRpc3Rpbmd1aXNoLCBmcm9tIHRoZSBldmVudCwgd2hldGhlciB0aGUgd2luZG93Ci0gICAg ICAgICAgICAgaGFzIGJlY29tZSBpY29uaWZpZWQgb3IgaW52aXNpYmxlLiAgU28gYXNzdW1lLCBp ZiBpdAotICAgICAgICAgICAgIHdhcyBwcmV2aW91c2x5IHZpc2libGUsIHRoYW4gbm93IGl0IGlz IGljb25pZmllZC4KLSAgICAgICAgICAgICBCdXQgeF9tYWtlX2ZyYW1lX2ludmlzaWJsZSBjbGVh cnMgYm90aAotICAgICAgICAgICAgIHRoZSB2aXNpYmxlIGZsYWcgYW5kIHRoZSBpY29uaWZpZWQg ZmxhZzsKLSAgICAgICAgICAgICBhbmQgdGhhdCB3YXksIHdlIGtub3cgdGhlIHdpbmRvdyBpcyBu b3QgaWNvbmlmaWVkIG5vdy4gICovCi0gICAgICAgICAgaWYgKHZpc2libGUgfHwgRlJBTUVfSUNP TklGSUVEX1AgKGYpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBTRVRfRlJBTUVfSUNP TklGSUVEIChmLCB0cnVlKTsKLSAgICAgICAgICAgICAgaW5ldi5pZS5raW5kID0gSUNPTklGWV9F VkVOVDsKLSAgICAgICAgICAgICAgWFNFVEZSQU1FIChpbmV2LmllLmZyYW1lX29yX3dpbmRvdywg Zik7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwkgIC8qIFdoaWxlIGEgZnJhbWUgaXMgdW5t YXBwZWQsIGRpc3BsYXkgZ2VuZXJhdGlvbiBpcworCSAgICAgZGlzYWJsZWQ7IHlvdSBkb24ndCB3 YW50IHRvIHNwZW5kIHRpbWUgdXBkYXRpbmcgYQorCSAgICAgZGlzcGxheSB0aGF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HRoYXQgdGhlCisJIGZyYW1lIGlzIHZpc2libGUuICAqLwogICAgICAg ZiA9IHhfdG9wX3dpbmRvd190b19mcmFtZSAoZHB5aW5mbywgZXZlbnQtPnhtYXAud2luZG93KTsK ICAgICAgIGlmIChmKQotICAgICAgICB7CisJewogCSAgYm9vbCBpY29uaWZpZWQgPSBGUkFNRV9J Q09OSUZJRURfUCAoZik7CiAKLSAgICAgICAgICAvKiBDaGVjayBpZiBmdWxsc2NyZWVuIHdhcyBz cGVjaWZpZWQgYmVmb3JlIHdlIHdoZXJlIG1hcHBlZCB0aGUKLSAgICAgICAgICAgICBmaXJzdCB0 aW1lLCBpLmUuIGZyb20gdGhlIGNvbW1hbmQgbGluZS4gICovCi0gICAgICAgICAgaWYgKCFmLT5v dXRwdXRfZGF0YS54LT5oYXNfYmVlbl92aXNpYmxlKQotICAgICAgICAgICAgeF9jaGVja19mdWxs c2NyZWVuIChmKTsKLQotICAgICAgICAgIFNFVF9GUkFNRV9WSVNJQkxFIChmLCAxKTsKLSAgICAg ICAgICBTRVRfRlJBTUVfSUNPTklGSUVEIChmLCBmYWxzZSk7Ci0gICAgICAgICAgZi0+b3V0cHV0 X2RhdGEueC0+aGFzX2JlZW5fdmlzaWJsZSA9IHRydWU7Ci0KLSAgICAgICAgICBpZiAoaWNvbmlm aWVkKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICBpbmV2LmllLmtpbmQgPSBERUlDT05J RllfRVZFTlQ7Ci0gICAgICAgICAgICAgIFhTRVRGUkFNRSAoaW5ldi5pZS5mcmFtZV9vcl93aW5k b3csIGYpOwotICAgICAgICAgICAgfQotICAgICAgICAgIGVsc2UgaWYgKCEgTklMUCAoVmZyYW1l X2xpc3QpICYmICEgTklMUCAoWENEUiAoVmZyYW1lX2xpc3QpKSkKLSAgICAgICAgICAgIC8qIEZv cmNlIGEgcmVkaXNwbGF5IHNvb25lciBvciBsYXRlciB0byB1cGRhdGUgdGhlCisJICAvKiBDaGVj ayBpZiBmdWxs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ZmluZWQgKFVTRV9YX1RPT0xLSVQpIHx8IGRlZmlu ZWQgKFVTRV9HVEspCiAgICAgICAvKiBEaXNwYXRjaCBLZXlQcmVzcyBldmVudHMgd2hlbiBpbiBt ZW51LiAgKi8KICAgICAgIGlmIChwb3B1cF9hY3RpdmF0ZWQgKCkpCi0gICAgICAgIGdvdG8gT1RI RVI7CisJZ290byBPVEhFUjsKICNlbmRpZgogCiAgICAgICBmID0gYW55OwpAQCAtODAyOCwxMjcg KzgwMjgsMTI3IEBAIGhhbmRsZV9vbmVfeGV2ZW50IChzdHJ1Y3QgeF9kaXNwbGF5X2luZm8gKmRw eWluZm8sCiAJICAgICAgfHwgIUVRIChmLT50b29sX2Jhcl93aW5kb3csIGhsaW5mby0+bW91c2Vf ZmFjZV93aW5kb3cpKQogI2VuZGlmCiAJICApCi0gICAgICAgIHsKLSAgICAgICAgICBjbGVhcl9t b3VzZV9mYWNlIChobGluZm8pOwotICAgICAgICAgIGhsaW5mby0+bW91c2VfZmFjZV9oaWRkZW4g PSB0cnVlOwotICAgICAgICB9CisJeworCSAgY2xlYXJfbW91c2VfZmFjZSAoaGxpbmZvKTsKKwkg IGhsaW5mby0+bW91c2VfZmFjZV9oaWRkZW4gPSB0cnVlOworCX0KIAogI2lmIGRlZmluZWQgVVNF X01PVElGICYmIGRlZmluZWQgVVNFX1RPT0xLSVRfU0NST0xMX0JBUlMKICAgICAgIGlmIChmID09 IDApCi0gICAgICAgIHsKLSAgICAgICAgICAvKiBTY3JvbGwgYmFycyBjb25zdW1lIGtleSBldmVu dHMsIGJ1dCB3ZSB3YW50Ci0gICAgICAgICAgICAgdGhlIGtleXMgdG8gZ28gdG8gdGhlIHNjcm9s bCBiYXIncyBmcmFtZS4gICovCi0gICAgICAgICAgV2lkZ2V0IHdpZGdldCA9IFh0V2luZG93VG9X aWRnZXQgKGRweWluZm8tPmRpc3BsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIGV2ZW50LT54a2V5LndpbmRvdyk7Ci0gICAgICAgICAgaWYgKHdpZGdldCAm JiBYbUlzU2Nyb2xsQmFyICh3aWRnZXQpKQotICAgICAgICAgICAgewotICAgICAgICAgICAgICB3 aWRnZXQgPSBYdFBhcmVudCAod2lkZ2V0KTsKLSAgICAgICAgICAgICAgZiA9IHhfYW55X3dpbmRv d190b19mcmFtZSAoZHB5aW5mbywgWHRXaW5kb3cgKHdpZGdldCkpOwotICAgICAgICAgICAgfQot ICAgICAgICB9CisJeworCSAgLyogU2Nyb2xsIGJhcnMgY29uc3VtZSBrZXkgZXZlbnRzLCBidXQg d2Ugd2FudAorCSAgICAgdGhlIGtleXMgdG8gZ28gdG8gdGhlIHNjcm9sbCBiYXIncyBmcmFtZS4g ICovCisJICBXaWRnZXQgd2lkZ2V0ID0gWHRXaW5kb3dUb1dpZGdldCAoZHB5aW5mby0+ZGlzcGxh eSwKKwkJCQkJICAgIGV2ZW50LT54a2V5LndpbmRvdyk7CisJICBpZiAod2lkZ2V0ICYmIFhtSXNT Y3JvbGxCYXIgKHdpZGdldCkpCisJICAgIHsKKwkgICAgICB3aWRnZXQgPSBYdFBhcmVudCAod2lk Z2V0KTsKKwkgICAgICBmID0geF9hbnlfd2luZG93X3RvX2ZyYW1lIChkcHlpbmZvLCBYdFdpbmRv dyAod2lkZ2V0KSk7CisJICAgIH0KKwl9CiAjZW5kaWYgLyogVVNFX01PVElGIGFuZCBVU0VfVE9P TEtJVF9TQ1JPTExfQkFSUyAqLwogCiAgICAgICBpZiAoZiAhPSAwKQotICAgICAgICB7Ci0gICAg ICAgICAgS2V5U3ltIGtleXN5bSwgb3JpZ19rZXlzeW07Ci0gICAgICAgICAgLyogYWwlaW1lcmN1 cnlAdXVuZXQudXUubmV0IHNheXMgdGhhdCBtYWtpbmcgdGhpcyA4MQotICAgICAgICAgICAgIGlu c3RlYWQgb2YgODAgZml4ZWQgYSBidWcgd2hlcmVieSBtZXRhIGNoYXJzIG1hZGUKLSAgICAgICAg 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emVvZiAoY29tcG9z ZV9zdGF0dXMpKTsKKwkgIC8qIEluIGNhc2UgTWV0YSBpcyBDb21wb3NlQ2hhcmFjdGVyLAorCSAg ICAgY2xlYXIgaXRzIHN0YXR1cy4gIEFjY29yZGluZyB0byBNYXJrdXMgRWhybnNwZXJnZXIKKwkg ICAgIE1hcmt1cy5FaHJuc3BlcmdlckBsZWhyc3R1aGwtYnJvc3MucGh5c2lrLnVuaS1tdWVuY2hl bi5kZQorCSAgICAgdGhpcyBlbmFibGVzIENvbXBvc2VDaGFyYWN0ZXIgdG8gd29yayB3aGV0aGVy IG9yCisJICAgICBub3QgaXQgaXMgY29tYmluZWQgd2l0aCBNZXRhLiAgKi8KKwkgIGlmIChtb2Rp ZmllcnMgJiBkcHlpbmZvLT5tZXRhX21vZF9tYXNrKQorCSAgICBtZW1zZXQgKCZjb21wb3NlX3N0 YXR1cywgMCwgc2l6ZW9mIChjb21wb3NlX3N0YXR1cykpOwogCiAjaWZkZWYgSEFWRV9YX0kxOE4K LSAgICAgICAgICBpZiAoRlJBTUVfWElDIChmKSkKLSAgICAgICAgICAgIHsKLSAgICAgICAgICAg ICAgU3RhdHVzIHN0YXR1c19yZXR1cm47Ci0KLSAgICAgICAgICAgICAgY29kaW5nX3N5c3RlbSA9 IFZsb2NhbGVfY29kaW5nX3N5c3RlbTsKLSAgICAgICAgICAgICAgbmJ5dGVzID0gWG1iTG9va3Vw U3RyaW5nIChGUkFNRV9YSUMgKGYpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICZ4a2V5LCAoY2hhciAqKSBjb3B5X2J1ZnB0ciwKLSAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICBjb3B5X2J1ZnNpeiwgJmtleXN5bSwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAmc3RhdHVzX3JldHVybik7Ci0gICAgICAgICAgICAg IGlmIChzdGF0dXNfcmV0dXJuID09IFhCdWZmZXJPdmVyZmxvdykKLSAgICAgICAgICAgICAgICB7 Ci0gICAgICAgICAgICAgICAgICBjb3B5X2J1ZnNpeiA9IG5ieXRlcyArIDE7Ci0gICAgICAgICAg ICAgICAgICBjb3B5X2J1ZnB0ciA9IGFsbG9jYSAoY29weV9idWZzaXopOwotICAgICAgICAgICAg ICAgICAgbmJ5dGVzID0gWG1iTG9va3VwU3RyaW5nIChGUkFNRV9YSUMgKGYpLAotICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAmeGtleSwgKGNoYXIgKikgY29weV9i dWZwdHIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGNvcHlf YnVmc2l6LCAma2V5c3ltLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmc3RhdHVzX3JldHVybik7Ci0gICAgICAgICAgICAgICAgfQotICAgICAgICAgICAgICAv KiBYdXRmOExvb2t1cFN0cmluZyBpcyBhIG5ldyBidXQgYWxyZWFkeSBkZXByZWNhdGVkIGludGVy ZmFjZS4gIC1zdGVmICAqLwotICAgICAgICAgICAgICBpZiAoc3RhdHVzX3JldHVybiA9PSBYTG9v a3VwTm9uZSkKLSAgICAgICAgICAgICAgICBicmVhazsKLSAgICAgICAgICAgICAgZWxzZSBpZiAo c3RhdHVzX3JldHVybiA9PSBYTG9va3VwQ2hhcnMpCi0gICAgICAgICAgICAgICAgewotICAgICAg ICAgICAgICAgICAga2V5c3ltID0gTm9TeW1ib2w7Ci0gICAgICAgICAgICAgICAgICBtb2RpZmll cnMgPSAwOwotICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgZWxzZSBpZiAoc3RhdHVz X3JldHVybiAhPSBYTG9va3VwS2V5U3ltCi0gICAgICAgICAgICAgICAgICAgICAgICYmIHN0YXR1 c19yZXR1cm4gIT0gWExvb2t1cEJvdGgpCi0gICAgICAgICAgICAgICAgZW1hY3NfYWJvcnQgKCk7 Ci0gICAgICAgICAgICB9Ci0gICAgICAgICAgZWxzZQotICAgICAgICAgICAgbmJ5dGVzID0gWExv b2t1cFN0cmluZyAoJnhrZXksIChjaGFyICopIGNvcHlfYnVmcHRyLAotICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgY29weV9idWZzaXosICZrZXlzeW0sCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAmY29tcG9zZV9zdGF0dXMpOworCSAgaWYgKEZSQU1FX1hJ QyAoZikpCisJICAgIHsKKwkgICAgICBTdGF0dXMgc3RhdHVzX3JldHVybjsKKworCSAgICAgIGNv ZGluZ19zeXN0ZW0gPSBWbG9jYWxlX2NvZGluZ19zeXN0ZW07CisJICAgICAgbmJ5dGVzID0gWG1i TG9va3VwU3RyaW5nIChGUkFNRV9YSUMgKGYpLAorCQkJCQkmeGtleSwgKGNoYXIgKikgY29weV9i dWZwdHIsCisJCQkJCWNvcHlfYnVmc2l6LCAma2V5c3ltLAorCQkJCQkmc3RhdHVzX3JldHVybik7 CisJICAgICAgaWYgKHN0YXR1c19yZXR1cm4gPT0gWEJ1ZmZlck92ZXJmbG93KQorCQl7CisJCSAg Y29weV9idWZzaXogPSBuYnl0ZXMgKyAxOworCQkgIGNvcHlfYnVmcHRyID0gYWxsb2NhIChjb3B5 X2J1ZnNpeik7CisJCSAgbmJ5dGVzID0gWG1iTG9va3VwU3RyaW5nIChGUkFNRV9YSUMgKGYpLAor CQkJCQkgICAgJnhrZXksIChjaGFyICopIGNvcHlfYnVmcHRyLAorCQkJCQkgICAgY29weV9idWZz aXosICZrZXlzeW0sCisJCQkJCSAgICAmc3RhdHVzX3JldHVybik7CisJCX0KKwkgICAgICAvKiBY dXRmOExvb2t1cFN0cmluZyBpcyBhIG5ldyBidXQgYWxyZWFkeSBkZXByZWNhdGVkIGludGVyZmFj ZS4gIC1zdGVmICAqLworCSAgICAgIGlmIChzdGF0dXNfcmV0dXJuID09IFhMb29rdXBOb25lKQor CQlicmVhazsKKwkgICAgICBlbHNlIGlmIChzdGF0dXNfcmV0dXJuID09IFhMb29rdXBDaGFycykK KwkJeworCQkgIGtleXN5bSA9IE5vU3ltYm9sOworCQkgIG1vZGlmaWVycyA9IDA7CisJCX0KKwkg ICAgICBlbHNlIGlmIChzdGF0dXNfcmV0dXJuICE9IFhMb29rdXBLZXlTeW0KKwkJICAgICAgICYm IHN0YXR1c19yZXR1cm4gIT0gWExvb2t1cEJvdGgpCisJCWVtYWNzX2Fib3J0ICgpOworCSAgICB9 CisJICBlbHNlCisJICAgIG5ieXRlcyA9IFhMb29rdXBTdHJpbmcgKCZ4a2V5LCAoY2hhciAqKSBj b3B5X2J1ZnB0ciwKKwkJCQkgICAgY29weV9idWZzaXosICZrZXlzeW0sCisJCQkJICAgICZjb21w b3NlX3N0YXR1cyk7CiAjZWxzZQotICAgICAgICAgIG5ieXRlcyA9IFhMb29rdXBTdHJpbmcgKCZ4 a2V5LCAoY2hhciAqKSBjb3B5X2J1ZnB0ciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBjb3B5X2J1ZnNpeiwgJmtleXN5bSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAmY29tcG9zZV9zdGF0dXMpOworCSAgbmJ5dGVzID0gWExvb2t1cFN0cmluZyAoJnhrZXks IChjaGFyICopIGNvcHlfYnVmcHRyLAorCQkJCSAgY29weV9idWZzaXosICZrZXlzeW0sCisJCQkJ ICAmY29tcG9zZV9zdGF0dXMpOwogI2VuZGlmCiAKLSAgICAgICAgICAvKiBJZiBub3QgdXNpbmcg WElNL1hJQywgYW5kIGEgY29tcG9zZSBzZXF1ZW5jZSBpcyBpbiBwcm9ncmVzcywKLSAgICAgICAg ICAgICB3ZSBicmVhayBoZXJlLiAgT3RoZXJ3aXNlLCBjaGFyc19tYXRjaGVkIGlzIGFsd2F5cyAw LiAgKi8KLSAgICAgICAgICBpZiAoY29tcG9zZV9zdGF0dXMuY2hhcnNfbWF0Y2hlZCA+IDAgJiYg bmJ5dGVzID09IDApCi0gICAgICAgICAgICBicmVhazsKKwkgIC8qIElmIG5vdCB1c2luZyBYSU0v WElDLCBhbmQgYSBjb21wb3NlIHNlcXVlbmNlIGlzIGluIHByb2dyZXNzLAorCSAgICAgd2UgYnJl YWsgaGVyZS4gIE90aGVyd2lzZSwgY2hhcnNfbWF0Y2hlZCBpcyBhbHdheXMgMC4gICovCisJICBp ZiAoY29tcG9zZV9zdGF0dXMuY2hhcnNfbWF0Y2hlZCA+IDAgJiYgbmJ5dGVzID09IDApCisJICAg IGJyZWFrOwogCi0gICAgICAgICAgbWVtc2V0ICgmY29tcG9zZV9zdGF0dXMsIDAsIHNpemVvZiAo Y29tcG9zZV9zdGF0dXMpKTsKLSAgICAgICAgICBvcmlnX2tleXN5bSA9IGtleXN5bTsKKwkgIG1l bXNldCAoJmNvbXBvc2Vfc3RhdHVzLCAwLCBzaXplb2YgKGNvbXBvc2Vfc3RhdHVzKSk7CisJICBv cmlnX2tleXN5bSA9IGtleXN5bTsKIAogIAkgIC8qIENvbW1vbiBmb3IgYWxsIGtleXN5bSBpbnB1 dCBldmVudHMuICAqLwogIAkgIFhTRVRGUkFNRSAoaW5ldi5pZS5mcmFtZV9vcl93aW5kb3csIGYp OwpAQCAtODE4NSw4MyArODE4NSw4MyBAQCBoYW5kbGVfb25lX3hldmVudCAoc3RydWN0IHhfZGlz cGxheV9pbmZvICpkcHlpbmZvLAogCQkgIE5BVE5VTVAgKGMpKSkKICAJICAgIHsKICAJICAgICAg aW5ldi5pZS5raW5kID0gKFNJTkdMRV9CWVRFX0NIQVJfUCAoWEZBU1RJTlQgKGMpKQotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgPyBBU0NJSV9LRVlTVFJPS0VfRVZFTlQKLSAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDogTVVMVElCWVRFX0NIQVJfS0VZU1RST0tFX0VWRU5UKTsK KwkJCSAgICAgID8gQVNDSUlfS0VZU1RST0tFX0VWRU5UCisJCQkgICAgICA6IE1VTFRJQllURV9D SEFSX0tFWVNUUk9LRV9FVkVOVCk7CiAgCSAgICAgIGluZXYuaWUuY29kZSA9IFhGQVNUSU5UIChj KTsKICAJICAgICAgZ290byBkb25lX2tleXN5bTsKICAJICAgIH0KIAogIAkgIC8qIFJhbmRvbSBu b24tbW9kaWZpZXIgc29ydHMgb2Yga2V5c3ltcy4gICovCiAgCSAgaWYgKCgoa2V5c3ltID49IFhL X0JhY2tTcGFjZSAmJiBrZXlzeW0gPD0gWEtfRXNjYXBlKQotICAgICAgICAgICAgICAgICAgICAg ICAgfHwga2V5c3ltID09IFhLX0RlbGV0ZQorCQkJfHwga2V5c3ltID09IFhLX0RlbGV0ZQogI2lm ZGVmIFhLX0lTT19MZWZ0X1RhYgotICAgICAgICAgICAgICAgICAgICAgICAgfHwgKGtleXN5bSA+ PSBYS19JU09fTGVmdF9UYWIKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAmJiBrZXlzeW0g PD0gWEtfSVNPX0VudGVyKQorCQkJfHwgKGtleXN5bSA+PSBYS19JU09fTGVmdF9UYWIKKwkJCSAg ICAmJiBrZXlzeW0gPD0gWEtfSVNPX0VudGVyKQogI2VuZGlmCi0gICAgICAgICAgICAgICAgICAg ICAgICB8fCBJc0N1cnNvcktleSAoa2V5c3ltKSAvKiAweGZmNTAgPD0geCA8IDB4ZmY2MCAqLwot ICAgICAgICAgICAgICAgICAgICAgICAgfHwgSXNNaXNjRnVuY3Rpb25LZXkgKGtleXN5bSkgLyog MHhmZjYwIDw9IHggPCBWQVJJRVMgKi8KKwkJCXx8IElzQ3Vyc29yS2V5IChrZXlzeW0pIC8qIDB4 ZmY1MCA8PSB4IDwgMHhmZjYwICovCisJCQl8fCBJc01pc2NGdW5jdGlvbktleSAoa2V5c3ltKSAv KiAweGZmNjAgPD0geCA8IFZBUklFUyAqLwogI2lmZGVmIEhQVVgKLSAgICAgICAgICAgICAgICAg ICAgICAgIC8qIFRoaXMgcmVjb2duaXplcyB0aGUgImV4dGVuZGVkIGZ1bmN0aW9uCi0gICAgICAg ICAgICAgICAgICAgICAgICAgICBrZXlzIi4gIEl0IHNlZW1zIHRoZXJlJ3Mgbm8gY2xlYW5lciB3 YXkuCi0gICAgICAgICAgICAgICAgICAgICAgICAgICBUZXN0IElzTW9kaWZpZXJLZXkgdG8gYXZv aWQgaGFuZGxpbmcKLSAgICAgICAgICAgICAgICAgICAgICAgICAgIG1vZGVfc3dpdGNoIGluY29y cmVjdGx5LiAgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IChYS19TZWxlY3QgPD0ga2V5 c3ltICYmIGtleXN5bSA8IFhLX0tQX1NwYWNlKQorCQkJLyogVGhpcyByZWNvZ25pemVzIHRoZSAi ZXh0ZW5kZWQgZnVuY3Rpb24KKwkJCSAgIGtleXMiLiAgSXQgc2VlbXMgdGhlcmUncyBubyBjbGVh bmVyIHdheS4KKwkJCSAgIFRlc3QgSXNNb2RpZmllcktleSB0byBhdm9pZCBoYW5kbGluZworCQkJ ICAgbW9kZV9zd2l0Y2ggaW5jb3JyZWN0bHkuICAqLworCQkJfHwgKFhLX1NlbGVjdCA8PSBrZXlz eW0gJiYga2V5c3ltIDwgWEtfS1BfU3BhY2UpCiAjZW5kaWYKICNpZmRlZiBYS19kZWFkX2NpcmN1 bWZsZXgKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IG9yaWdfa2V5c3ltID09IFhLX2RlYWRf Y2lyY3VtZmxleAorCQkJfHwgb3JpZ19rZXlzeW0gPT0gWEtfZGVhZF9jaXJjdW1mbGV4CiAjZW5k aWYKICNpZmRlZiBYS19kZWFkX2dyYXZlCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCBvcmln X2tleXN5bSA9PSBYS19kZWFkX2dyYXZlCisJCQl8fCBvcmlnX2tleXN5bSA9PSBYS19kZWFkX2dy YXZlCiAjZW5kaWYKICNpZmRlZiBYS19kZWFkX3RpbGRlCi0gICAgICAgICAgICAgICAgICAgICA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2JyZXZlCiAjZW5kaWYKICNpZmRlZiBYS19kZWFk X29nb25lawotICAgICAgICAgICAgICAgICAgICAgICAgfHwgb3JpZ19rZXlzeW0gPT0gWEtfZGVh ZF9vZ29uZWsKKwkJCXx8IG9yaWdfa2V5c3ltID09IFhLX2RlYWRfb2dvbmVrCiAjZW5kaWYKICNp ZmRlZiBYS19kZWFkX2Nhcm9uCi0gICAgICAgICAgICAgICAgICAgICAgICB8fCBvcmlnX2tleXN5 bSA9PSBYS19kZWFkX2Nhcm9uCisJCQl8fCBvcmlnX2tleXN5bSA9PSBYS19kZWFkX2Nhcm9uCiAj ZW5kaWYKICNpZmRlZiBYS19kZWFkX2RvdWJsZWFjdXRlCi0gICAgICAgICAgICAgICAgICAgICAg ICB8fCBvcmlnX2tleXN5bSA9PSBYS19kZWFkX2RvdWJsZWFjdXRlCisJCQl8fCBvcmlnX2tleXN5 bSA9PSBYS19kZWFkX2RvdWJsZWFjdXRlCiAjZW5kaWYKICNpZmRlZiBYS19kZWFkX2Fib3ZlZG90 Ci0gICAgICAgICAgICAgICAgICAgICAgICB8fCBvcmlnX2tleXN5bSA9PSBYS19kZWFkX2Fib3Zl ZG90Ci0jZW5kaWYKLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IElzS2V5cGFkS2V5IChrZXlz eW0pIC8qIDB4ZmY4MCA8PSB4IDwgMHhmZmJlICovCi0gICAgICAgICAgICAgICAgICAgICAgICB8 fCBJc0Z1bmN0aW9uS2V5IChrZXlzeW0pIC8qIDB4ZmZiZSA8PSB4IDwgMHhmZmUxICovCi0gICAg ICAgICAgICAgICAgICAgICAgICAvKiBBbnkgInZlbmRvci1zcGVjaWZpYyIga2V5IGlzIG9rLiAg Ki8KLSAgICAgICAgICAgICAgICAgICAgICAgIHx8IChvcmlnX2tleXN5bSAmICgxIDw8IDI4KSkK LSAgICAgICAgICAgICAgICAgICAgICAgIHx8IChrZXlzeW0gIT0gTm9TeW1ib2wgJiYgbmJ5dGVz ID09IDApKQotICAgICAgICAgICAgICAgICAgICAgICAmJiAhIChJc01vZGlmaWVyS2V5IChvcmln X2tleXN5bSkKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgLyogVGhlIHN5bWJvbHMgZnJv bSBYS19JU09fTG9jawotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB0byBYS19JU09f TGFzdF9Hcm91cF9Mb2NrCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGRvbid0IGhh dmUgcmVhbCBtb2RpZmllcnMgYnV0Ci0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHNo b3VsZCBiZSB0cmVhdGVkIHNpbWlsYXJseSB0bwotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICBNb2RlX3N3aXRjaCBieSBFbWFjcy4gKi8KKwkJCXx8IG9yaWdfa2V5c3ltID09IFhLX2Rl YWRfYWJvdmVkb3QKKyNlbmRpZgorCQkJfHwgSXNLZXlwYWRLZXkgKGtleXN5bSkgLyogMHhmZjgw IDw9IHggPCAweGZmYmUgKi8KKwkJCXx8IElzRnVuY3Rpb25LZXkgKGtleXN5bSkgLyogMHhmZmJl IDw9IHggPCAweGZmZTEgKi8KKwkJCS8qIEFueSAidmVuZG9yLXNwZWNpZmljIiBrZXkgaXMgb2su ICAqLworCQkJfHwgKG9yaWdfa2V5c3ltICYgKDEgPDwgMjgpKQorCQkJfHwgKGtleXN5bSAhPSBO b1N5bWJvbCAmJiBuYnl0ZXMgPT0gMCkpCisJCSAgICAgICAmJiAhIChJc01vZGlmaWVyS2V5IChv cmlnX2tleXN5bSkKKwkJCSAgICAgLyogVGhlIHN5bWJvbHMgZnJvbSBYS19JU09fTG9jaworCQkJ CXRvIFhLX0lTT19MYXN0X0dyb3VwX0xvY2sKKwkJCQlkb24ndCBoYXZlIHJlYWwgbW9kaWZpZXJz IGJ1dAorCQkJCXNob3VsZCBiZSB0cmVhdGVkIHNpbWlsYXJseSB0bworCQkJCU1vZGVfc3dpdGNo IGJ5IEV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AgICAgaWYg KCFmICYmIGRweWluZm8tPmxhc3RfbW91c2VfZ2x5cGhfZnJhbWUpCi0gICAgICAgIG5vdGVfbW91 c2VfbW92ZW1lbnQgKGRweWluZm8tPmxhc3RfbW91c2VfZ2x5cGhfZnJhbWUsICZldmVudC0+eG1v dGlvbik7CisJbm90ZV9tb3VzZV9tb3ZlbWVudCAoZHB5aW5mby0+bGFzdF9tb3VzZV9nbHlwaF9m cmFtZSwgJmV2ZW50LT54bW90aW9uKTsKICNlbmRpZgogICAgICAgZ290byBPVEhFUjsKIApAQCAt ODM4NSwyNiArODM4NSwyNiBAQCBoYW5kbGVfb25lX3hldmVudCAoc3RydWN0IHhfZGlzcGxheV9p bmZvICpkcHlpbmZvLAogCiAgICAgICBmID0geF90b3Bfd2luZG93X3RvX2ZyYW1lIChkcHlpbmZv LCBldmVudC0+eGNyb3NzaW5nLndpbmRvdyk7CiAgICAgICBpZiAoZikKLSAgICAgICAgewotICAg ICAgICAgIGlmIChmID09IGhsaW5mby0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSkKLSAgICAgICAg ICAgIHsKLSAgICAgICAgICAgICAgLyogSWYgd2UgbW92ZSBvdXRzaWRlIHRoZSBmcmFtZSwgdGhl biB3ZSdyZQotICAgICAgICAgICAgICAgICBjZXJ0YWlubHkgbm8gbG9uZ2VyIG9uIGFueSB0ZXh0 IGluIHRoZSBmcmFtZS4gICovCi0gICAgICAgICAgICAgIGNsZWFyX21vdXNlX2ZhY2UgKGhsaW5m byk7Ci0gICAgICAgICAgICAgIGhsaW5mby0+bW91c2VfZmFjZV9tb3VzZV9mcmFtZSA9IDA7Ci0g ICAgICAgICAgICB9Ci0KLSAgICAgICAgICAvKiBHZW5lcmF0ZSBhIG5pbCBIRUxQX0VWRU5UIHRv IGNhbmNlbCBhIGhlbHAtZWNoby4KLSAgICAgICAgICAgICBEbyBpdCBvbmx5IGlmIHRoZXJlJ3Mg c29tZXRoaW5nIHRvIGNhbmNlbC4KLSAgICAgICA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ZXZl bnQgKHN0cnVjdCB4X2Rpc3BsYXlfaW5mbyAqZHB5aW5mbywKIAkJLyogUmVtZW1iZXIgdGhlIGxh c3Qgd2luZG93IHdoZXJlIHdlIHNhdyB0aGUgbW91c2UuICAqLwogCQlsYXN0X21vdXNlX3dpbmRv dyA9IHdpbmRvdzsKIAkgICAgICB9Ci0gICAgICAgICAgICBpZiAoIW5vdGVfbW91c2VfbW92ZW1l bnQgKGYsICZldmVudC0+eG1vdGlvbikpCisJICAgIGlmICghbm90ZV9tb3VzZV9tb3ZlbWVudCAo ZiwgJmV2ZW50LT54bW90aW9uKSkKIAkgICAgICBoZWxwX2VjaG9fc3RyaW5nID0gcHJldmlvdXNf aGVscF9lY2hvX3N0cmluZzsKLSAgICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICB7 CisJICB9CisJZWxzZQorCSAgewogI2lmbmRlZiBVU0VfVE9PTEtJVF9TQ1JPTExfQkFSUwotICAg ICAgICAgICAgc3RydWN0IHNjcm9sbF9iYXIgKmJhcgotICAgICAgICAgICAgICA9IHhfd2luZG93 X3RvX3Njcm9sbF9iYXIgKGV2ZW50LT54bW90aW9uLmRpc3BsYXksCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgZXZlbnQtPnhtb3Rpb24ud2luZG93LCAyKTsKKwkgICAg c3RydWN0IHNjcm9sbF9iYXIgKmJhcgorCSAgICAgID0geF93aW5kb3dfdG9fc2Nyb2xsX2JhciAo ZXZlbnQtPnhtb3Rpb24uZGlzcGxheSwKKwkJCQkJZXZlbnQtPnhtb3Rpb24ud2luZG93LCAyKTsK IAotICAgICAgICAgICAgaWYgKGJhcikKLSAgICAgICAgICAgICAgeF9zY3JvbGxfYmFyX25vdGVf bW92ZW1lbnQgKGJhciwgJmV2ZW50LT54bW90aW9uKTsKKwkgICAgaWYgKGJhcikKKwkgICAgICB4 X3Njcm9sbF9iYXJfbm90ZV9tb3ZlbWVudCAoYmFyLCAmZXZlb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worCSAgeF9jcl9kZXN0cm95X3N1cmZh Y2UgKGYpOwogI2VuZGlmCi0gICAgICAgICAgZiA9IDA7Ci0gICAgICAgIH0KKwkgIGYgPSAwOwor CX0KICNlbmRpZgogICAgICAgaWYgKGYpCi0gICAgICAgIHsKKwl7CiAKLSAgICAgICAgICB4X25l dF93bV9zdGF0ZSAoZiwgY29uZmlndXJlRXZlbnQueGNvbmZpZ3VyZS53aW5kb3cpOworCSAgeF9u ZXRfd21fc3RhdGUgKGYsIGNvbmZpZ3VyZUV2ZW50Lnhjb25maWd1cmUud2luZG93KTsKIAogI2lm ZGVmIFVTRV9YX1RPT0xLSVQKLSAgICAgICAgICAvKiBUaXAgZnJhbWVzIGFyZSBwdXJlIFggd2lu ZG93LCBzZXQgc2l6ZSBmb3IgdGhlbS4gICovCi0gICAgICAgICAgaWYgKCEgTklMUCAodGlwX2Zy YW1lKSAmJiBYRlJBTUUgKHRpcF9mcmFtZSkgPT0gZikKLSAgICAgICAgICAgIHsKLSAgICAgICAg ICAgICAgaWYgKEZSQU1FX1BJWEVMX0hFSUdIVCAoZikgIT0gY29uZmlndXJlRXZlbnQueGNvbmZp Z3VyZS5oZWlnaHQKLSAgICAgICAgICAgICAgICAgIHx8IEZSQU1FX1BJWEVMX1dJRFRIIChmKSAh PSBjb25maWd1cmVFdmVudC54Y29uZmlndXJlLndpZHRoKQotICAgICAgICAgICAgICAgIHsKLSAg ICAgICAgICAgICAgICAgIFNFVF9GUkFNRV9HQVJCQUdFRCAoZik7Ci0gICAgICAgICAgICAgICAg fQotICAgICAgICAgICAgICBGUkFNRV9QSVhFTF9IRUlHSFQgKGYpID0gY29uZmlndXJlRXZlbnQu eGNvbmZpZ3VyZS5oZWlnaHQ7Ci0gICAgICAgICAgICAgIEZSQU1FX1BJWEVMX1dJRFRIIChmKSA9 IGNvbmZpZ3VyZUV2ZW50Lnhjb25maWd1cmUud2lkdGg7Ci0gICAgICAgICAgICB9CisJICAvKiBU aXAgZnJhbWVzIGFyZ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aGUgRW1hY3NGcmFtZSB3aWRn ZXQuICAqLwotCi0gICAgICAgICAgLyogRXZlbiBpZiB0aGUgbnVtYmVyIG9mIGNoYXJhY3RlciBy b3dzIGFuZCBjb2x1bW5zIGhhcwotICAgICAgICAgICAgIG5vdCBjaGFuZ2VkLCB0aGUgZm9udCBz aXplIG1heSBoYXZlIGNoYW5nZWQsIHNvIHdlIG5lZWQKLSAgICAgICAgICAgICB0byBjaGVjayB0 aGUgcGl4ZWwgZGltZW5zaW9ucyBhcyB3ZWxsLiAgKi8KLSAgICAgICAgICBpZiAod2lkdGggIT0g RlJBTUVfVEVYVF9XSURUSCAoZikKLSAgICAgICAgICAgICAgfHwgaGVpZ2h0ICE9IEZSQU1FX1RF WFRfSEVJR0hUIChmKQotICAgICAgICAgICAgICB8fCBjb25maWd1cmVFdmVudC54Y29uZmlndXJl LndpZHRoICE9IEZSQU1FX1BJWEVMX1dJRFRIIChmKQotICAgICAgICAgICAgICB8fCBjb25maWd1 cmVFdmVudC54Y29uZmlndXJlLmhlaWdodCAhPSBGUkFNRV9QSVhFTF9IRUlHSFQgKGYpKQotICAg ICAgICAgICAgewotICAgICAgICAgICAgICBjaGFuZ2VfZnJhbWVfc2l6ZSAoZiwgd2lkdGgsIGhl aWdodCwgZmFsc2UsIHRydWUsIGZhbHNlLCB0cnVlKTsKLSAgICAgICAgICAgICAgeF9jbGVhcl91 bmRlcl9pbnRlcm5hbF9ib3JkZXIgKGYpOwotICAgICAgICAgICAgICBTRVRfRlJBTUVfR0FSQkFH RUQgKGYpOwotICAgICAgICAgICAgICBjYW5jZWxfbW91c2VfZmFjZSAoZik7Ci0gICAgICAgICAg ICB9CisJICAvKiBJbiB0aGUgdG9vbGtpdCB2ZXJzaW9uLCBjaGFuZ2VfZnJhbWVfc2l6ZQorCSAg ICAgaXMgY2FsbGVkIGJ5IHRoZSBjb2RlIHRoYXQgaGFuZGxlcyByZXNpemluZworCSAgICAgb2Yg dGhlIEVtYWNzRnJhbWUgd2lk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50b29sX2Jhcl93aW5kb3cpKSkK LSAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgIExpc3BfT2JqZWN0IHdpbmRvdzsKLSAg ICAgICAgICAgICAgICBpbnQgeCA9IGV2ZW50LT54YnV0dG9uLng7Ci0gICAgICAgICAgICAgICAg aW50IHkgPSBldmVudC0+eGJ1dHRvbi55OwotCi0gICAgICAgICAgICAgICAgd2luZG93ID0gd2lu ZG93X2Zyb21fY29vcmRpbmF0ZXMgKGYsIHgsIHksIDAsIHRydWUpOwotICAgICAgICAgICAgICAg IHRvb2xfYmFyX3AgPSBFUSAod2luZG93LCBmLT50b29sX2Jhcl93aW5kb3cpOwotCi0gICAgICAg ICAgICAgICAgaWYgKHRvb2xfYmFyX3AgJiYgZXZlbnQtPnhidXR0b24uYnV0dG9uIDwgNCkKKwkg ICAgLyogSXMgdGhpcyBpbiB0aGUgdG9vbC1iYXI/ICAqLworCSAgICBpZiAoV0lORE9XUCAoZi0+ dG9vbF9iYXJfd2luZG93KQorCQkmJiBXSU5ET1dfVE9UQUxfTElORVMgKFhXSU5ET1cgKGYtPnRv b2xfYmFyX3dpbmRvdykpKQorCSAgICAgIHsKKwkJTGlzcF9PYmplY3Qgd2luZG93OworCQlpbnQg eCA9IGV2ZW50LT54YnV0dG9uLng7CisJCWludCB5ID0gZXZlbnQtPnhidXR0b24ueTsKKworCQl3 aW5kb3cgPSB3aW5kb3dfZnJvbV9jb29yZGluYXRlcyAoZiwgeCwgeSwgMCwgdHJ1ZSk7CisJCXRv b2xfYmFyX3AgPSBFUSAod2luZG93LCBmLT50b29sX2Jhcl93aW5kb3cpOworCisJCWlmICh0b29s X2Jhcl9wICYmIGV2ZW50LT54YnV0dG9uLmJ1dHRvbiA8IDQpCiAJCSAgaGFuZGxlX3Rvb2xfYmFy X2NsaWNrCiAJCSAgICAoZiwgeCwgeSwgZXZlbnQtPnhidXR0b24udHlwZSA9PSBCdXR0b25QcmVz cywKIAkJICAgICB4X3hfdG9fZW1hY3NfbW9kaWZpZXJzIChkcHlpbmZvLCBldmVudC0+eGJ1dHRv bi5zdGF0ZSkpOwotICAgICAgICAgICAgICB9CisJICAgICAgfQogI2VuZGlmIC8qICFVU0VfR1RL ICovCiAKLSAgICAgICAgICAgIGlmICghdG9vbF9iYXJfcCkKKwkgICAgaWYgKCF0b29sX2Jhcl9w KQogI2lmIGRlZmluZWQgKFVTRV9YX1RPT0xLSVQpIHx8IGRlZmluZWQgKFVTRV9HVEspCi0gICAg ICAgICAgICAgIGlmICghIHBvcHVwX2FjdGl2YXRlZCAoKSkKLSNlbmRpZgotICAgICAgICAgICAg ICAgIHsKLSAgICAgICAgICAgICAgICAgIGlmIChpZ25vcmVfbmV4dF9tb3VzZV9jbGlja190aW1l b3V0KQotICAgICAgICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgICAgICAgaWYgKGV2 ZW50LT50eXBlID09IEJ1dHRvblByZXNzCi0gICAgICAgICAgICAgICAgICAgICAgICAgICYmIGV2 ZW50LT54YnV0dG9uLnRpbWUgPiBpZ25vcmVfbmV4dF9tb3VzZV9jbGlja190aW1lb3V0KQotICAg ICAgICAgICAgICAgICAgICAgICAgewotICAgICAgICAgICAgICAgICAgICAgICAgICBpZ25vcmVf bmV4dF9tb3VzZV9jbGlja190aW1lb3V0ID0gMDsKLSAgICAgICAgICAgICAgICAgICAgICAgICAg Y29uc3RydWN0X21vdXNlX2NsaWNrICgmaW5ldi5pZSwgJmV2ZW50LT54YnV0dG9uLCBmKTsKLSAg ICAgICAgICAgICAgICAgICAgICAgIH0KLSAgICAgICAgICAgICAgICAgICAgICBpZiAoZXZlbnQt PnR5cGUgPT0gQnV0dG9uUmVsZWFzZSkKLSAgICAgICAgICAgICAgICAgICAgICAgIGlnbm9yZV9u ZXh0X21vdXNlX2NsaWNrX3RpbWVvdXQgPSAwOwotICAgICAgICAgICAgICAgICAgICB9Ci0gICAg ICAgICAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAgICAgICAgIGNvbnN0cnVjdF9tb3VzZV9j bGljayAoJmluZXYuaWUsICZldmVudC0+eGJ1dHRvbiwgZik7Ci0gICAgICAgICAgICAgICAgfQot ICAgICAgICAgICAgaWYgKEZSQU1FX1hfRU1CRURERURfUCAoZikpCi0gICAgICAgICAgICAgIHhl bWJlZF9zZW5kX21lc3NhZ2UgKGYsIGV2ZW50LT54YnV0dG9uLnRpbWUsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIFhFTUJFRF9SRVFVRVNUX0ZPQ1VTLCAwLCAwLCAwKTsKLSAg ICAgICAgICB9Ci0gICAgICAgIGVsc2UKLSAgICAgICAgICB7Ci0gICAgICAgICAgICBzdHJ1Y3Qg c2Nyb2xsX2JhciAqYmFyCi0gICAgICAgICAgICAgID0geF93aW5kb3dfdG9fc2Nyb2xsX2JhciAo ZXZlbnQtPnhidXR0b24uZGlzcGxheSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICBldmVudC0+eGJ1dHRvbi53aW5kb3csIDIpOworCSAgICAgIGlmICghIHBvcHVwX2Fj dGl2YXRlZCAoKSkKKyNlbmRpZgorCQl7CisJCSAgaWYgKGlnbm9yZV9uZXh0X21vdXNlX2NsaWNr X3RpbWVvdXQpCisJCSAgICB7CisJCSAgICAgIGlmIChldmVudC0+dHlwZSA9PSBCdXR0b25QcmVz cworCQkJICAmJiBldmVudC0+eGJ1dHRvbi50aW1lID4gaWdub3JlX25leHRfbW91c2VfY2xpY2tf dGltZW91dCkKKwkJCXsKKwkJCSAgaWdub3JlX25leHRfbW91c2VfY2xpY2tfdGltZW91dCA9IDA7 CisJCQkgIGNvbnN0cnVjdF9tb3VzZV9jbGljayAoJmluZXYuaWUsICZldmVudC0+eGJ1dHRvbiwg Zik7CisJCQl9CisJCSAgICAgIGlmIChldmVudC0+dHlwZSA9PSBCdXR0b25SZWxlYXNlKQorCQkJ aWdub3JlX25leHRfbW91c2VfY2xpY2tfdGltZW91dCA9IDA7CisJCSA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JICAgICAgeworCQl4X3Njcm9sbF9iYXJfaGFuZGxlX2NsaWNrIChi YXIsIGV2ZW50LCAmaW5ldi5pZSk7CisJCSpmaW5pc2ggPSBYX0VWRU5UX0RST1A7CisJICAgICAg fQogI2Vsc2UgLyogbm90IFVTRV9UT09MS0lUX1NDUk9MTF9CQVJTICovCi0gICAgICAgICAgICBp ZiAoYmFyKQotICAgICAgICAgICAgICB4X3Njcm9sbF9iYXJfaGFuZGxlX2NsaWNrIChiYXIsIGV2 ZW50LCAmaW5ldi5pZSk7CisJICAgIGlmIChiYXIpCisJICAgICAgeF9zY3JvbGxfYmFyX2hhbmRs ZV9jbGljayAoYmFyLCBldmVudCwgJmluZXYuaWUpOwogI2VuZGlmIC8qIG5vdCBVU0VfVE9PTEtJ VF9TQ1JPTExfQkFSUyAqLwotICAgICAgICAgIH0KKwkgIH0KIAotICAgICAgICBpZiAoZXZlbnQt PnR5cGUgPT0gQnV0dG9uUHJlc3MpCi0gICAgICAgICAgewotICAgICAgICAgICAgZHB5aW5mby0+ Z3JhYmJlZCB8PSAoMSA8PCBldmVudC0+eGJ1dHRvbi5idXR0b24pOwotICAgICAgICAgICAgZHB5 aW5mby0+bGFzdF9tb3VzZV9mcmFtZSA9IGY7CisJaWYgKGV2ZW50LT50eXBlID09IEJ1dHRvblBy ZXNzKQorCSAgeworCSAgICBkcHlpbmZvLT5ncmFiYmVkIHw9ICgxIDw8IGV2ZW50LT54YnV0dG9u LmJ1dHRvbik7CisJICAgIGRweWluZm8tPmxhc3RfbW91c2VfZnJhbWUgPSBmOwogI2lmICEgZGVm aW5lZCAoVVNFX0dUSykKLSAgICAgICAgICAgIGlmIChmICYmICF0b29sX2Jhcl9wKQotICAgICAg ICAgICAgICBmLT5sYXN0X3Rvb2xfYmFyX2l0ZW0gPSAtMTsKKwkgICAgaWYgKGYgJiYgIXRvb2xf YmFyX3ApCisJICAgICAgZi0+bGFzdF90b29sX2Jhcl9pdGVtID0gLTE7CiAjZW5kaWYgLyogb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FtZSAoZHB5aW5mbywgZXZlbnQpOworCS8qIEZvciBhIGRvd24t ZXZlbnQgaW4gdGhlIG1lbnUgYmFyLAorCSAgIGRvbid0IHBhc3MgaXQgdG8gWHQgcmlnaHQgbm93 LgorCSAgIEluc3RlYWQsIHNhdmUgaXQgYXdheQorCSAgIGFuZCB3ZSB3aWxsIHBhc3MgaXQgdG8g WHQgZnJvbSBrYmRfYnVmZmVyX2dldF9ldmVudC4KKwkgICBUaGF0IHdheSwgd2UgY2FuIHJ1biBz b21lIExpc3AgY29kZSBmaXJzdC4gICovCisJaWYgKCEgcG9wdXBfYWN0aXZhdGVkICgpCiAjaWZk ZWYgVVNFX0dUSwotICAgICAgICAgICAgLyogR3RrKyBtZW51cyBvbmx5IHJlYWN0IHRvIHRoZSBm aXJzdCB0aHJlZSBidXR0b25zLiAqLwotICAgICAgICAgICAgJiYgZXZlbnQtPnhidXR0b24uYnV0 dG9uIDwgMwotI2VuZGlmCi0gICAgICAgICAgICAmJiBmICYmIGV2ZW50LT50eXBlID09IEJ1dHRv blByZXNzCi0gICAgICAgICAgICAvKiBWZXJpZnkgdGhlIGV2ZW50IGlzIHJlYWxseSB3aXRoaW4g dGhlIG1lbnUgYmFyCi0gICAgICAgICAgICAgICBhbmQgbm90IGp1c3Qgc2VudCB0byBpdCBkdWUg dG8gZ3JhYmJpbmcuICAqLwotICAgICAgICAgICAgJiYgZXZlbnQtPnhidXR0b24ueCA+PSAwCi0g ICAgICAgICAgICAmJiBldmVudC0+eGJ1dHRvbi54IDwgRlJBTUVfUElYRUxfV0lEVEggKGYpCi0g ICAgICAgICAgICAmJiBldmVudC0+eGJ1dHRvbi55ID49IDAKLSAgICAgICAgICAgICYmIGV2ZW50 LT54YnV0dG9uLnkgPCBGUkFNRV9NRU5VQkFSX0hFSUdIVCAoZikKLSAgICAgICAgICAgICYmIGV2 ZW50LT54YnV0dG9uLnNhbWVfc2NyZWVuKQotICAgICAgICAgIHsKKwkgICAgLyogR3RrKyBtZW51 c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kBAIC05MTI5LDggKzkxMjksOCBAQCB4X2RyYXdfYmFyX2N1cnNv ciAoc3RydWN0IHdpbmRvdyAqdywgc3RydWN0IGdseXBoX3JvdyAqcm93LCBpbnQgd2lkdGgsIGVu dW0gdGV4dAogCSAgICB4ICs9IGN1cnNvcl9nbHlwaC0+cGl4ZWxfd2lkdGggLSB3LT5waHlzX2N1 cnNvcl93aWR0aCArIDE7CiAJICB4X2ZpbGxfcmVjdGFuZ2xlIChmLCBnYywgeCwKIAkJCSAgICBX SU5ET1dfVE9fRlJBTUVfUElYRUxfWSAodywgdy0+cGh5c19jdXJzb3IueSArCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHJvdy0+aGVpZ2h0IC0g d2lkdGgpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgIHctPnBoeXNfY3Vyc29yX3dpZHRo IC0gMSwgd2lkdGgpOworCQkJCQkJICAgICByb3ctPmhlaWdodCAtIHdpZHRoKSwKKwkJCSAgICB3 LT5waHlzX2N1cnNvcl93aWR0aCAtIDEsIHdpZHRoKTsKIAl9CiAKICAgICAgIHhfcmVzZXRfY2xp cF9yZWN0YW5nbGVzIChmLCBnYyk7CkBAIC05MjU4LDEyICs5MjU4LDEyIEBAIHhfYml0bWFwX2lj b24gKHN0cnVjdCBmcmFtZSAqZiwgTGlzcF9PYmplY3QgZmlsZSkKIAogI2lmZGVmIFVTRV9HVEsK IAotICAgICAgICAgIGlmICh4Z19zZXRfaWNvbiAoZiwgeGdfZGVmYXVsdF9pY29uX2ZpbGUpCi0g ICAgICAgICAgICAgIHx8IHhnX3NldF9pY29uX2Zyb21feHBtX2RhdGEgKGYsIGdudV94cG1fYml0 cykpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIEZSQU1FX0RJU1BMQVlfSU5GTyAoZikt Pmljb25fYml0bWFwX2lkID0gLTI7Ci0gICAgICAgICAgICAgIHJldHVybiBmYWxzZTsKLSAgICAg ICA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gICAgICAgICAgICAg ICAgIC8qIDEgPSBhZGQsIDAgPSByZW1vdmUgKi8KLSAgICAgICAgICAgICAgICAgICAgICAgRmNv bnMKLSAgICAgICAgICAgICAgICAgICAgICAgKG1ha2VfbnVtYmVyIChhZGQpLAotICAgICAgICAg ICAgICAgICAgICAgICAgRmNvbnMKLSAgICAgICAgICAgICAgICAgICAgICAgIChtYWtlX2ZpeG51 bV9vcl9mbG9hdCAoYXRvbSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgKHZhbHVlICE9IDAK KwkJICAgICAgIGRweWluZm8tPlhhdG9tX25ldF93bV9zdGF0ZSwKKwkJICAgICAgIG1ha2VfbnVt YmVyICgzMiksCisJCSAgICAgICAvKiAxID0gYWRkLCAwID0gcmVtb3ZlICovCisJCSAgICAgICBG Y29ucworCQkgICAgICAgKG1ha2VfbnVtYmVyIChhZGQpLAorCQkJRmNvbnMKKwkJCShtYWtlX2Zp eG51bV9vcl9mbG9hdCAoYXRvbSksCisJCQkgKHZhbHVlICE9IDAKIAkJCSAgPyBsaXN0MSAobWFr ZV9maXhudW1fb3JfZmxvYXQgKHZhbHVlKSkKIAkJCSAgOiBRbmlsKSkpKTsKIH0KQEAgLTEwMjA0 LDcgKzEwMjA0LDcgQEAgeF9zZXRfc3RpY2t5IChzdHJ1Y3QgZnJhbWUgKmYsIExpc3BfT2JqZWN0 IG5ld192YWx1ZSwgTGlzcF9PYmplY3Qgb2xkX3ZhbHVlKQogICBYU0VURlJBTUUgKGZyYW1lLCBm KTsKIAogICBzZXRfd21fc3RhdGUgKGZyYW1lLCAhTklMUCAobmV3X3ZhbHVlKSwKLSAgICAgICAg ICAgICAgICBkcHlpbmZvLT5YYXRvbV9uZXRfd21fc3RhdGVfc3RpY2t5LCBOb25lKTsKKwkJZHB5 aW5mby0+WGF0b21fbmV0X3dtX3N0YXRlX3N0aWNreSwgTm9uZSk7CiB9CiAKIC8qIFJldHVybiB0 aGUgY3VycmVudCBfTkVUX1dNX1NUQVRFLgpAQCAtMTAyMTUsOSArMTAyMTUsOSBAQCB4X3NldF9z dGlja3kgKHN0cnVjdCBmcmFtZSAqZiwgTGlzcF9PYmplY3QgbmV3X3ZhbHVlLCBMaXNwX09iamVj dCBvbGRfdmFsdWUpCiAKIHN0YXRpYyBib29sCiBnZXRfY3VycmVudF93bV9zdGF0ZSAoc3RydWN0 IGZyYW1lICpmLAotICAgICAgICAgICAgICAgICAgICAgIFdpbmRvdyB3aW5kb3csCi0gICAgICAg ICAgICAgICAgICAgICAgaW50ICpzaXplX3N0YXRlLAotICAgICAgICAgICAgICAgICAgICAgIGJv b2wgKnN0aWNreSkKKwkJICAgICAgV2luZG93IHdpbmRvdywKKwkJICAgICAgaW50ICpzaXplX3N0 YXRlLAorCQkgICAgICBib29sICpzdGlja3kpCiB7CiAgIHVuc2lnbmVkIGxvbmcgYWN0dWFsX3Np emU7CiAgIGludCBpOwpAQCAtMTAyNDYsOCArMTAyNDYsOCBAQCBnZXRfY3VycmVudF93bV9zdGF0 ZSAoc3RydWN0IGZyYW1lICpmLAogCiAjaWZkZWYgVVNFX1hDQgogICBwcm9wX2Nvb2tpZSA9IHhj Yl9nZXRfcHJvcGVydHkgKGRweWluZm8tPnhjYl9jb25uZWN0aW9uLCAwLCB3aW5kb3csCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgZHB5aW5mby0+WGF0b21fbmV0X3dtX3N0YXRl LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIHRhcmdldF90eXBlLCAwLCBtYXhf bGVuKTsKKwkJCQkgIGRweWluZm8tPlhhdG9tX25ldF93bV9zdGF0ZSwKKwkJCQkgIHRhcmdldF90 eXBlLCAwLCBtYXhfbGVuKTsKICAgcHJvcCA9IHhjYl9nZXRfcHJvcGVydHlfcmVwbHkgKGRweWlu Zm8tPnhjYl9jb25uZWN0aW9uLCBwcm9wX2Nvb2tpZSwgTlVMTCk7CiAgIGlmIChwcm9wICYmIHBy b3AtPnR5cGUgPT0g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AgICAgICB7Ci0gICAgICAgICAg aWYgKCpzaXplX3N0YXRlID09IEZVTExTQ1JFRU5fSEVJR0hUKQotICAgICAgICAgICAgKnNpemVf c3RhdGUgPSBGVUxMU0NSRUVOX01BWElNSVpFRDsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAg ICAqc2l6ZV9zdGF0ZSA9IEZVTExTQ1JFRU5fV0lEVEg7Ci0gICAgICAgIH0KKwl7CisJICBpZiAo KnNpemVfc3RhdGUgPT0gRlVMTFNDUkVFTl9IRUlHSFQpCisJICAgICpzaXplX3N0YXRlID0gRlVM TFNDUkVFTl9NQVhJTUlaRUQ7CisJICBlbHNlCisJICAgICpzaXplX3N0YXRlID0gRlVMTFNDUkVF Tl9XSURUSDsKKwl9CiAgICAgICBlbHNlIGlmIChhID09IGRweWluZm8tPlhhdG9tX25ldF93bV9z dGF0ZV9tYXhpbWl6ZWRfdmVydCkKLSAgICAgICAgewotICAgICAgICAgIGlmICgqc2l6ZV9zdGF0 ZSA9PSBGVUxMU0NSRUVOX1dJRFRIKQotICAgICAgICAgICAgKnNpemVfc3RhdGUgPSBGVUxMU0NS RUVOX01BWElNSVpFRDsKLSAgICAgICAgICBlbHNlCi0gICAgICAgICAgICAqc2l6ZV9zdGF0ZSA9 IEZVTExTQ1JFRU5fSEVJR0hUOwotICAgICAgICB9CisJeworCSAgaWYgKCpzaXplX3N0YXRlID09 IEZVTExTQ1JFRU5fV0lEVEgpCisJICAgICpzaXplX3N0YXRlID0gRlVMTFNDUkVFTl9NQVhJTUla RUQ7CisJICBlbHNlCisJICAgICpzaXplX3N0YXRlID0gRlVMTFNDUkVFTl9IRUlHSFQ7CisJfQog ICAgICAgZWxzZSBpZiAoYSA9PSBkcHlpbmZvLT5YYXRvbV9uZXRfd21fc3RhdGVfZnVsbHNjcmVl bikKLSAgICAgICAgKnNpemVfc3RhdGUgPSBGVUxMU0NSRUVOX0JPVEg7CisJKnNpemVfc3RhdGUg PSBGVUxMU0NSRUVOX0JPVEg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A QCAtMTE5NjAsNjggKzExOTYwLDY4IEBAIHhfdGVybV9pbml0IChMaXNwX09iamVjdCBkaXNwbGF5 X25hbWUsIGNoYXIgKnhybV9vcHRpb24sIGNoYXIgKnJlc291cmNlX25hbWUpCiAKICAgICBpZiAo eF9pbml0aWFsaXplZCsrID4gMSkKICAgICAgIHsKLSAgICAgICAgeGdfZGlzcGxheV9vcGVuIChT U0RBVEEgKGRpc3BsYXlfbmFtZSksICZkcHkpOworCXhnX2Rpc3BsYXlfb3BlbiAoU1NEQVRBIChk aXNwbGF5X25hbWUpLCAmZHB5KTsKICAgICAgIH0KICAgICBlbHNlCiAgICAgICB7Ci0gICAgICAg IHN0YXRpYyBjaGFyIGRpc3BsYXlfb3B0W10gPSAiLS1kaXNwbGF5IjsKLSAgICAgICAgc3RhdGlj IGNoYXIgbmFtZV9vcHRbXSA9ICItLW5hbWUiOworCXN0YXRpYyBjaGFyIGRpc3BsYXlfb3B0W10g PSAiLS1kaXNwbGF5IjsKKwlzdGF0aWMgY2hhciBuYW1lX29wdFtdID0gIi0tbmFtZSI7CiAKLSAg ICAgICAgZm9yIChhcmdjID0gMDsgYXJnYyA8IE5VTV9BUkdWOyArK2FyZ2MpCi0gICAgICAgICAg YXJndlthcmdjXSA9IDA7CisJZm9yIChhcmdjID0gMDsgYXJnYyA8IE5VTV9BUkdWOyArK2FyZ2Mp CisJICBhcmd2W2FyZ2NdID0gMDsKIAotICAgICAgICBhcmdjID0gMDsKLSAgICAgICAgYXJndlth cmdjKytdID0gaW5pdGlhbF9hcmd2WzBdOworCWFyZ2MgPSAwOworCWFyZ3ZbYXJnYysrXSA9IGlu aXRpYWxfYXJndlswXTsKIAotICAgICAgICBpZiAoISBOSUxQIChkaXNwbGF5X25hbWUpKQotICAg ICAgICAgIHsKLSAgICAgICAgICAgIGFyZ3ZbYXJnYysrXSA9IGRpc3BsYXlfb3B0OwotICAgICAg ICAgICAgYXJndlthcmdjKytdID0gU1NEQVRBIChkaXNwbGF5X25hb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ZXN0X3NpZ2lvICgpOyAvKiBTZWUgY29tbWVudCBpbiB4X2Rpc3BsYXlf b2suICAqLworCWd0a19pbml0ICgmYXJnYywgJmFyZ3YyKTsKKwlyZXF1ZXN0X3NpZ2lvICgpOwor CWZpeHVwX2xvY2FsZSAoKTsKIAotICAgICAgICBnX2xvZ19yZW1vdmVfaGFuZGxlciAoIkdMaWIi LCBpZCk7CisJZ19sb2dfcmVtb3ZlX2hhbmRsZXIgKCJHTGliIiwgaWQpOwogCi0gICAgICAgIHhn X2luaXRpYWxpemUgKCk7CisJeGdfaW5pdGlhbGl6ZSAoKTsKIAotICAgICAgICBkcHkgPSBERUZB VUxUX0dES19ESVNQTEFZICgpOworCWRweSA9IERFRkFVTFRfR0RLX0RJU1BMQVkgKCk7CiAKICNp ZiAhIEdUS19DSEVDS19WRVJTSU9OICgyLCA5MCwgMCkKLSAgICAgICAgLyogTG9hZCBvdXIgb3du IGd0a3JjIGlmIGl0IGV4aXN0cy4gICovCi0gICAgICAgIHsKLSAgICAgICAgICBjb25zdCBjaGFy ICpmaWxlID0gIn4vLmVtYWNzLmQvZ3RrcmMiOwotICAgICAgICAgIExpc3BfT2JqZWN0IHMsIGFi c19maWxlOworCS8qIExvYWQgb3VyIG93biBndGtyYyBpZiBpdCBleGlzdHMuICAqLworCXsKKwkg IGNvbnN0IGNoYXIgKmZpbGUgPSAifi8uZW1hY3MuZC9ndGtyYyI7CisJICBMaXNwX09iamVjdCBz LCBhYnNfZmlsZTsKIAotICAgICAgICAgIHMgPSBidWlsZF9zdHJpbmcgKGZpbGUpOwotICAgICAg ICAgIGFic19maWxlID0gRmV4cGFuZF9maWxlX25hbWUgKHMsIFFuaWwpOworCSAgcyA9IGJ1aWxk X3N0cmluZyAoZmlsZSk7CisJICBhYnNfZmlsZSA9IEZleHBhbmRfZmlsZV9uYW1lIChzLCBRbmls KTsKIAotICAgICAgICAgIGlmICghIE5JTFAgKGFic19maWxlKSAmJiAhTklMUCAoRmZpbGVfcmVh ZGFibGVfcCAoYWJzX2ZpbGUpKSkKLSAgICAgICAgICAgIGd0a19yY19wYXJzZSAoU1NEQVRBIChh YnNfZmlsZSkpOwotICAgICAgICB9CisJICBpZiAoISBOSUxQIChhYnNfZmlsZSkgJiYgIU5JTFAg KEZmaWxlX3JlYWRhYmxlX3AgKGFic19maWxlKSkpCisJICAgIGd0a19yY19wYXJzZSAoU1NEQVRB IChhYnNfZmlsZSkpOworCX0KICNlbmRpZgogCi0gICAgICAgIFhTZXRFcnJvckhhbmRsZXIgKHhf ZXJyb3JfaGFuZGxlcik7Ci0gICAgICAgIFhTZXRJT0Vycm9ySGFuZGxlciAoeF9pb19lcnJvcl9x dWl0dGVyKTsKKwlYU2V0RXJyb3JIYW5kbGVyICh4X2Vycm9yX2hhbmRsZXIpOworCVhTZXRJT0Vy cm9ySGFuZGxlciAoeF9pb19lcnJvcl9xdWl0dGVyKTsKICAgICAgIH0KICAgfQogI2Vsc2UgLyog bm90IFVTRV9HVEsgKi8KQEAgLTEyMjExLDExICsxMjIxMSwxMSBAQCB4X3Rlcm1faW5pdCAoTGlz cF9PYmplY3QgZGlzcGxheV9uYW1lLCBjaGFyICp4cm1fb3B0aW9uLCBjaGFyICpyZXNvdXJjZV9u YW1lKQogICBpZiAoZHB5aW5mby0+dmlzdWFsLT5jbGFzcyA9PSBUcnVlQ29sb3IpCiAgICAgewog ICAgICAgZ2V0X2JpdHNfYW5kX29mZnNldCAoZHB5aW5mby0+dmlzdWFsLT5yZWRfbWFzaywKLSAg ICAgICAgICAgICAgICAgICAgICAgICAgICZkcHlpbmZvLT5yZWRfYml0cywgJmRweWluZm8tPnJl ZF9vZmZzZXQpOworCQkJICAgJmRweWluZm8tPnJlZF9iaXRzLCAmZHB5aW5mby0+cmVkX29mZnNl dCk7CiAgICAgICBnZXRfYml0c19hbmRfb2Zmc2V0IChkcHlpbmZvLT52aXN1YWwtPmJsdWVfbWFz aywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICZkcHlpbmZ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CiAgICAgICAgKEZSQU1FX0dUS19PVVRFUl9XSURHRVQgKGYpID8gICAgICAg ICAgICAgICAgICAgICAgICAgICAgXAotICAgICAgICBHVEtfV0lER0VUX1RPX1hfV0lOIChGUkFN RV9HVEtfT1VURVJfV0lER0VUIChmKSkgOiAgICAgIFwKLSAgICAgICAgIEZSQU1FX1hfV0lORE9X IChmKSkKKwlHVEtfV0lER0VUX1RPX1hfV0lOIChGUkFNRV9HVEtfT1VURVJfV0lER0VUIChmKSkg OiAgICAgIFwKKwkgRlJBTUVfWF9XSU5ET1cgKGYpKQogCiAjZWxzZSAvKiAhVVNFX0dUSyAqLwog I2RlZmluZSBGUkFNRV9PVVRFUl9XSU5ET1coZikgKEZSQU1FX1hfV0lORE9XIChmKSkKQEAgLTEw NTYsMTUgKzEwNTYsMTUgQEAgU0VMRUNUSU9OX0VWRU5UX0RJU1BMQVkgKHN0cnVjdCBzZWxlY3Rp b25faW5wdXRfZXZlbnQgKmV2KQogZXh0ZXJuIHZvaWQgeF9mcmVlX2djcyAoc3RydWN0IGZyYW1l ICopOwogZXh0ZXJuIHZvaWQgeF9yZWxhdGl2ZV9tb3VzZV9wb3NpdGlvbiAoc3RydWN0IGZyYW1l ICosIGludCAqLCBpbnQgKik7CiBleHRlcm4gdm9pZCB4X3JlYWxfcG9zX2FuZF9vZmZzZXRzIChz dHJ1Y3QgZnJhbWUgKmYsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg KmxlZnRfb2Zmc2V0X3gsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg KnJpZ2h0X29mZnNldF94LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50 ICp0b3Bfb2Zmc2V0X3ksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBpbnQg KmJvdHRvbV9vZmZzZXRfeSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqeF9waXhlbHNfZGlmZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqeV9waXhlbHNfZGlmZiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGlu dCAqeHB0ciwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqeXB0ciwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIGludCAqb3V0ZXJfYm9yZGVyKTsK KwkJCQkgICAgaW50ICpsZWZ0X29mZnNldF94LAorCQkJCSAgICBpbnQgKnJpZ2h0X29mZnNldF94 LAorCQkJCSAgICBpbnQgKnRvcF9vZmZzZXRfeSwKKwkJCQkgICAgaW50ICpib3R0b21fb2Zmc2V0 X3ksCisJCQkJICAgIGludCAqeF9waXhlbHNfZGlmZiwKKwkJCQkgICAgaW50ICp5X3BpeGVsc19k aWZmLAorCQkJCSAgICBpbnQgKnhwdHIsCisJCQkJICAgIGludCAqeXB0ciwKKwkJCQkgICAgaW50 ICpvdXRlcl9ib3JkZXIpOwogCiAvKiBGcm9tIHhyZGIuYy4gICovCiAKQEAgLTExODMsMTEgKzEx ODMsMTEgQEAgZXh0ZXJuIHZvaWQgeF9oYW5kbGVfc2VsZWN0aW9uX2V2ZW50IChzdHJ1Y3Qgc2Vs ZWN0aW9uX2lucHV0X2V2ZW50ICopOwogZXh0ZXJuIHZvaWQgeF9jbGVhcl9mcmFtZV9zZWxlY3Rp b25zIChzdHJ1Y3QgZnJhbWUgKik7CiAKIGV4dGVybiB2b2lkIHhfc2VuZF9jbGllbnRfZXZlbnQg KExpc3BfT2JqZWN0IGRpc3BsYXksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBM aXNwX09iamVjdCBkZXN0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9P YmplY3QgZnJvbSwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIEF0b20gbWVzc2Fn ZV90eXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgZm9y bWF0LAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgTGlzcF9PYmplY3QgdmFsdWVz KTsKKwkJCQkgTGlzcF9PYmplY3QgZGVzdCwKKwkJCQkgTGlzcF9PYmplY3QgZnJvbSwKKwkJCQkg QXRvbSBtZXNzYWdlX3R5cGUsCisJCQkJIExpc3BfT2JqZWN0IGZvcm1hdCwKKwkJCQkgTGlzcF9P YmplY3QgdmFsdWVzKTsKIAogZXh0ZXJuIGJvb2wgeF9oYW5kbGVfZG5kX21lc3NhZ2UgKHN0cnVj dCBmcmFtZSAqLAogCQkJCSAgY29uc3QgWENsaWVudE1lc3NhZ2VFdmVudCAqLApAQCAtMTE5NSwx NCArMTE5NSwxNCBAQCBleHRlcm4gYm9vbCB4X2hhbmRsZV9kbmRfbWVzc2FnZSAoc3RydWN0IGZy YW1lICosCiAJCQkJICBzdHJ1Y3QgaW5wdXRfZXZlbnQgKik7CiBleHRlcm4gaW50IHhfY2hlY2tf cHJvcGVydHlfZGF0YSAoTGlzcF9PYmplY3QpOwogZXh0ZXJuIHZvaWQgeF9maWxsX3Byb3BlcnR5 X2RhdGEgKERpc3BsYXkgKiwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBMaXNw X09iamVjdCwKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB2b2lkICosCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgaW50KTsKKwkJCQkgIExpc3BfT2JqZWN0LAor CQkJCSAgdm9pZCAqLAorCQkJCSAgaW50KTsKIGV4dGVybiBMaXNwX09iamVjdCB4X3Byb3BlcnR5 X2RhdGFfdG9fbGlzcCAoc3RydWN0IGZyYW1lICosCi0gICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGNvbnN0IHVuc2lnbmVkIGNoYXIgKiwKLSAgICAgICAgICAgICAg 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vd25sb2FkX2NiIChXZWJLaXRXZWJDb250ZXh0ICosIFdlYktpdERvd25sb2Fk ICosIGdwb2ludGVyKTsKIAogc3RhdGljIGdib29sZWFuCiB3ZWJraXRfZGVjaWRlX3BvbGljeV9j YiAoV2ViS2l0V2ViVmlldyAqLAotICAgICAgICAgICAgICAgICAgICAgICAgIFdlYktpdFBvbGlj eURlY2lzaW9uICosCi0gICAgICAgICAgICAgICAgICAgICAgICAgV2ViS2l0UG9saWN5RGVjaXNp b25UeXBlLAotICAgICAgICAgICAgICAgICAgICAgICAgIGdwb2ludGVyKTsKKwkJCSBXZWJLaXRQ b2xpY3lEZWNpc2lvbiAqLAorCQkJIFdlYktpdFBvbGljeURlY2lzaW9uVHlwZSwKKwkJCSBncG9p bnRlcik7CiAKIAogREVGVU4gKCJtYWtlLXh3aWRnZXQiLApAQCAtMTAxLDUyICsxMDEsNTIgQEAg UmV0dXJucyB0aGUgbmV3bHkgY29uc3RydWN0ZWQgeHdpZGdldCwgb3IgbmlsIGlmIGNvbnN0cnVj dGlvbiBmYWlscy4gICovKQogICAgICAgYmxvY2tfaW5wdXQgKCk7CiAgICAgICB4dy0+d2lkZ2V0 d2luZG93X29zciA9IGd0a19vZmZzY3JlZW5fd2luZG93X25ldyAoKTsKICAgICAgIGd0a193aW5k b3dfcmVzaXplIChHVEtfV0lORE9XICh4dy0+d2lkZ2V0d2luZG93X29zciksIHh3LT53aWR0aCwK LSAgICAgICAgICAgICAgICAgICAgICAgICB4dy0+aGVpZ2h0KTsKKwkJCSB4dy0+aGVpZ2h0KTsK IAogICAgICAgaWYgKEVRICh4dy0+dHlwZSwgUXdlYmtpdCkpCi0gICAgICAgIHsKLSAgICAgICAg ICB4dy0+d2lkZ2V0X29zciA9IHdlYmtpdF93ZWJfdmlld19uZXcgKCk7Ci0gICAgICAgIH0KKwl7 CisJICB4dy0+d2lkZ2V0X29zciA9IHdlYmtpdF93ZWJfdmlld19uZXcgKCk7CisJfQogCiAgICAg ICBndGtfd2lkZ2V0X3NldF9zaXplX3JlcXVlc3QgKEdUS19XSURHRVQgKHh3LT53aWRnZXRfb3Ny KSwgeHctPndpZHRoLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICB4dy0+aGVp Z2h0KTsKKwkJCQkgICB4dy0+aGVpZ2h0KTsKIAogICAgICAgaWYgKEVRICh4dy0+dHlwZSwgUXdl YmtpdCkpCi0gICAgICAgIHsKLSAgICAgICAgICBndGtfY29udGFpbmVyX2FkZCAoR1RLX0NPTlRB SU5FUiAoeHctPndpZGdldHdpbmRvd19vc3IpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAg ICBHVEtfV0lER0VUIChXRUJLSVRfV0VCX1ZJRVcgKHh3LT53aWRnZXRfb3NyKSkpOwotICAgICAg ICB9CisJeworCSAgZ3RrX2NvbnRhaW5lcl9hZGQgKEdUS19DT05UQUlORVIgKHh3LT53aWRnZXR3 aW5kb3dfb3NyKSwKKwkJCSAgICAgR1RLX1dJREdFVCAoV0VCS0lUX1dFQl9WSUVXICh4dy0+d2lk Z2V0X29zcikpKTsKKwl9CiAgICAgICBlbHNlCi0gICAgICAgIHsKLSAgICAgICAgICBndGtfY29u dGFpbmVyX2FkZCAoR1RLX0NPTlRBSU5FUiAoeHctPndpZGdldHdpbmRvd19vc3IpLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICB4dy0+d2lkZ2V0X29zcik7Ci0gICAgICAgIH0KKwl7CisJ ICBndGtfY29udGFpbmVyX2FkZCAoR1RLX0NPTlRBSU5FUiAoeHctPndpZGdldHdpbmRvd19vc3Ip LAorCQkJICAgICB4dy0+d2lkZ2V0X29zcik7CisJfQogCiAgICAgICBndGtfd2lkZ2V0X3Nob3cg KHh3LT53aWRnZXRfb3NyKTsKICAgICAgIGd0a193aWRnZXRfc2hvdyAoeHctPndpZGdldHdpbmRv d19vc3IpOwogCiAgICAgICAvKiBTdG9yZSBzb21lIHh3aWRnZXQgZGF0YSBpbiB0aGUgZ3RrIHdp ZGdldHMgZm9yIGNvbnZlbmllbnQKLSAgICAgICAgIHJldHJpZXZhbCBpbiB0aGUgZXZlbnQgaGFu ZGxlcnMuICAqLworCSByZXRyaWV2YWwgaW4gdGhlIGV2ZW50IGhhbmRsZXJzLiAgKi8KICAgICAg IGdfb2JqZWN0X3NldF9kYXRhIChHX09CSkVDVCAoeHctPndpZGdldF9vc3IpLCBYR19YV0lER0VU LCB4dyk7CiAgICAgICBnX29iamVjdF9zZXRfZGF0YSAoR19PQkpFQ1QgKHh3LT53aWRnZXR3aW5k b3dfb3NyKSwgWEdfWFdJREdFVCwgeHcpOwogCiAgICAgICAvKiBzaWduYWxzICovCiAgICAgICBp ZiAoRVEgKHh3LT50eXBlLCBRd2Via2l0KSkKLSAgICAgICAgewotICAgICAgICAgIGdfc2lnbmFs X2Nvbm5lY3QgKEdfT0JKRUNUICh4dy0+d2lkZ2V0X29zciksCi0gICAgICAgICAgICAgICAgICAg ICAgICAgICAgImxvYWQtY2hhbmdlZCIsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgR19D QUxMQkFDSyAod2Via2l0X3ZpZXdfbG9hZF9jaGFuZ2VkX2NiKSwgeHcpOwotCi0gICAgICAgICAg Z19zaWduYWxfY29ubmVjdCAoR19PQkpFQ1QgKHdlYmtpdF93ZWJfY29udGV4dF9nZXRfZGVmYXVs dCAoKSksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgImRvd25sb2FkLXN0YXJ0ZWQiLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdfQ0FMTEJBQ0sgKHdlYmtpdF9kb3dubG9hZF9j YiksIHh3KTsKLQotICAgICAgICAgIGdfc2lnbmFsX2Nvbm5lY3QgKEdfT0JKRUNUICh4dy0+d2lk Z2V0X29zciksCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgImRlY2lkZS1wb2xpY3kiLAot ICAgICAgICAgICAgICAgICAgICAgICAgICAgIEdfQ0FMTEJBQ0sKLSAgICAgICAgICAgICAgICAg IC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aWRnZXQgKnh3LAotICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgTGlzcF9PYmplY3QgcHJvYywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIExpc3BfT2JqZWN0IGFyZ3VtZW50KQorCQkJCSBMaXNwX09iamVjdCBwcm9jLAorCQkJCSBM aXNwX09iamVjdCBhcmd1bWVudCkKIHsKICAgc3RydWN0IGlucHV0X2V2ZW50IGV2ZW50OwogICBM aXNwX09iamVjdCB4d2w7CkBAIC0yNTYsMTQgKzI1NiwxNCBAQCBzdG9yZV94d2lkZ2V0X2pzX2Nh bGxiYWNrX2V2ZW50IChzdHJ1Y3QgeHdpZGdldCAqeHcsCiAKIHZvaWQKIHdlYmtpdF92aWV3X2xv YWRfY2hhbmdlZF9jYiAoV2ViS2l0V2ViVmlldyAqd2Via2l0d2VidmlldywKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgV2ViS2l0TG9hZEV2ZW50IGxvYWRfZXZlbnQsCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgIGdwb2ludGVyIGRhdGEpCisJCQkgICAgIFdlYktpdExvYWRFdmVu dCBsb2FkX2V2ZW50LAorCQkJICAgICBncG9pbnRlciBkYXRhKQogewogICBzd2l0Y2ggKGxvYWRf ZXZlbnQpIHsKICAgY2FzZSBXRUJLSVRfTE9BRF9GSU5JU0hFRDoKICAgICB7CiAgICAgICBzdHJ1 Y3QgeHdpZGdldCAqeHcgPSBnX29iamVjdF9nZXRfZGF0YSAoR19PQkpFQ1QgKHdlYmtpdHdlYnZp ZXcpLAotICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhHX1hX SURHRVQpOworCQkJCQkgICAgICBYR19YV0lER0VUKTsKICAgICAgIHN0b3JlX3h3aWRnZXRfZXZl bnRfc3RyaW5nICh4dywgImxvYWQtY2hhbmdlZCIsICIiKTsKICAgICAgIGJyZWFrOwogICAgIH0K QEAgLTI4MCwxNiArMjgw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gICAgIGZvciAoaW50 IGkgPSAwOyBpIDwgbjsgKytpKQotICAgICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgcC0+ Y29udGVudHNbaV0gPQotICAgICAgICAgICAgICAgICAgd2Via2l0X2pzX3RvX2xpc3AgKGNvbnRl eHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgSlNPYmplY3RHZXRQcm9w ZXJ0eUF0SW5kZXggKGNvbnRleHQsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChKU09iamVjdFJlZikgdmFsdWUsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgIGksIE5VTEwpKTsKLSAgICAgICAgICAgICAgfQotICAgICAgICAgICAgWFNFVFZFQ1RPUiAo b2JqLCBwKTsKLSAgICAgICAgICAgIHJldHVybiBvYmo7Ci0gICAgICAgICAgfQotICAgICAgICBl bHNlCi0gICAgICAgICAgewotICAgICAgICAgICAgSlNQcm9wZXJ0eU5hbWVBcnJheVJlZiBwcm9w ZXJ0aWVzID0KLSAgICAgICAgICAgICAgSlNPYmplY3RDb3B5UHJvcGVydHlOYW1lcyAoY29udGV4 dCwgKEpTT2JqZWN0UmVmKSB2YWx1ZSk7Ci0KLSAgICAgICAgICAgIGludCBuID0gSlNQcm9wZXJ0 eU5hbWVBcnJheUdldENvdW50IChwcm9wZXJ0aWVzKTsKLSAgICAgICAgICAgIExpc3BfT2JqZWN0 IG9iajsKLQotICAgICAgICAgICAgLyogVE9ETzogY2FuIHdlIHVzZSBhIHJlZ3VsYXIgbGlzdCBo ZXJlPyAgKi8KLSAgICAgICAgICAgIHN0cnVjdCBMaXNwX1ZlY3RvciAqcCA9IGFsbG9jYXRlX3Zl Y3RvciAobik7Ci0KLSAgICAgICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgbjsgKytpKQotICAg ICAgICAgICAgICB7Ci0gICAgICAgICAgICAgICAgSlNTdHJpbmdSZWYgbmFtZSA9IEpTUHJvcGVy dHlOYW1lQXJyYXlHZXROYW1lQXRJbmRleCAocHJvcGVydGllcywgaSk7Ci0gICAgICAgICAgICAg ICAgSlNWYWx1ZVJlZiBwcm9wZXJ0eSA9IEpTT2JqZWN0R2V0UHJvcGVydHkgKGNvbnRleHQsCi0g ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg IChKU09iamVjdFJlZikgdmFsdWUsCi0gICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIG5hbWUsIE5VTEwpOwotICAgICAgICAgICAgICAgIGdj aGFyICpzdHJfbmFtZTsKLSAgICAgICAgICAgICAgICBnc2l6ZSBzdHJfbGVuZ3RoOwotICAgICAg ICAgICAgICAgIHN0cl9sZW5ndGggPSBKU1N0cmluZ0dldE1heGltdW1VVEY4Q1N0cmluZ1NpemUg KG5hbWUpOwotICAgICAgICAgICAgICAgIHN0cl9uYW1lID0gKGdjaGFyICopZ19tYWxsb2MgKHN0 cl9sZW5ndGgpOwotICAgICAgICAgICAgICAgIEpTU3RyaW5nR2V0VVRGOENTdHJpbmcgKG5hbWUs IHN0cl9uYW1lLCBzdHJfbGVuZ3RoKTsKLSAgICAgICAgICAgICAgICBKU1N0cmluZ1JlbGVhc2Ug KG5hbWUpOwotCi0gICAgICAgICAgICAgICAgcC0+Y29udGVudHNbaV0gPQotICAgICAgICAgICAg ICAgICAgRmNvbnMgKGJ1aWxkX3N0cmluZyAoc3RyX25hbWUpLAotICAgICAgICAgICAgICAgICAg ICAgICAgIHdlYmtpdF9qc190b19saXNwIChjb250ZXh0LCBwcm9wZXJ0eSkpOwotICAgICAgICAg ICAgICB9Ci0KLSAgICAgICAgICAgIEpTUHJvcGVydHlOYW1lQXJyYXlSZWxlYXNlIChwcm9wZXJ0 aWVzKTsKLSAgICAgICAg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ICAgICAgfQogICAgIGNhc2Uga0pTVHlwZVVuZGVmaW5lZDoK ICAgICBjYXNlIGtKU1R5cGVOdWxsOgpAQCAtMzYxLDI0ICszNjEsMjQgQEAgd2Via2l0X2pzX3Rv X2xpc3AgKEpTQ29udGV4dFJlZiBjb250ZXh0LCBKU1ZhbHVlUmVmIHZhbHVlKQogCiBzdGF0aWMg dm9pZAogd2Via2l0X2phdmFzY3JpcHRfZmluaXNoZWRfY2IgKEdPYmplY3QgICAgICAqd2Vidmll dywKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBHQXN5bmNSZXN1bHQgKnJlc3VsdCwK LSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICBncG9pbnRlciAgICAgIGxpc3BfY2FsbGJh Y2spCisJCQkgICAgICAgR0FzeW5jUmVzdWx0ICpyZXN1bHQsCisJCQkgICAgICAgZ3BvaW50ZXIg ICAgICBsaXNwX2NhbGxiYWNrKQogewogICAgIFdlYktpdEphdmFzY3JpcHRSZXN1bHQgKmpzX3Jl c3VsdDsKICAgICBKU1ZhbHVlUmVmIHZhbHVlOwogICAgIEpTR2xvYmFsQ29udGV4dFJlZiBjb250 ZXh0OwogICAgIEdFcnJvciAqZXJyb3IgPSBOVUxMOwogICAgIHN0cnVjdCB4d2lkZ2V0ICp4dyA9 IGdfb2JqZWN0X2dldF9kYXRhIChHX09CSkVDVCAod2VidmlldyksCi0gICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFhHX1hXSURHRVQpOworCQkJCQkgICAgWEdfWFdJ REdFVCk7CiAKICAgICBqc19yZXN1bHQgPSB3ZWJraXRfd2ViX3ZpZXdfcnVuX2phdmFzY3JpcHRf ZmluaXNoCiAgICAgICAoV0VCS0lUX1dFQl9WSUVXICh3ZWJ2aWV3KSwgcmVzdWx0LCAmZXJyb3Ip OwogCiAgICAgaWYgKCFqc19yZXN1bHQpCiAgICAgICB7Ci0gICAgICAgIGdfd2FybmluZyAoIkVy cm9yI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raXRfZGVjaWRlX3BvbGljeV9jYiAoV2ViS2l0V2ViVmlldyAqd2Vi VmlldywKICAgICAgICBwb3NzaWJsZSB0byBtYWtlIEVtYWNzIGhhbmRsZSBtaW1lIHRleHQgZm9y IGluc3RhbmNlLiAgKi8KICAgICB7CiAgICAgICBXZWJLaXRSZXNwb25zZVBvbGljeURlY2lzaW9u ICpyZXNwb25zZSA9Ci0gICAgICAgIFdFQktJVF9SRVNQT05TRV9QT0xJQ1lfREVDSVNJT04gKGRl Y2lzaW9uKTsKKwlXRUJLSVRfUkVTUE9OU0VfUE9MSUNZX0RFQ0lTSU9OIChkZWNpc2lvbik7CiAg ICAgICBpZiAoIXdlYmtpdF9yZXNwb25zZV9wb2xpY3lfZGVjaXNpb25faXNfbWltZV90eXBlX3N1 cHBvcnRlZCAocmVzcG9uc2UpKQotICAgICAgICB7Ci0gICAgICAgICAgd2Via2l0X3BvbGljeV9k ZWNpc2lvbl9kb3dubG9hZCAoZGVjaXNpb24pOwotICAgICAgICAgIHJldHVybiBUUlVFOwotICAg ICAgICB9CisJeworCSAgd2Via2l0X3BvbGljeV9kZWNpc2lvbl9kb3dubG9hZCAoZGVjaXNpb24p OworCSAgcmV0dXJuIFRSVUU7CisJfQogICAgICAgZWxzZQotICAgICAgICByZXR1cm4gRkFMU0U7 CisJcmV0dXJuIEZBTFNFOwogICAgICAgYnJlYWs7CiAgICAgfQogICBjYXNlIFdFQktJVF9QT0xJ Q1lfREVDSVNJT05fVFlQRV9ORVdfV0lORE9XX0FDVElPTjoKICAgY2FzZSBXRUJLSVRfUE9MSUNZ X0RFQ0lTSU9OX1RZUEVfTkFWSUdBVElPTl9BQ1RJT046CiAgICAgewogICAgICAgV2ViS2l0TmF2 aWdhdGlvblBvbGljeURlY2lzaW9uICpuYXZpZ2F0aW9uX2RlY2lzaW9uID0KLSAgICAgICAgV0VC S0lUX05BVklHQVRJT05fUE9MSUNZX0RFQ0lTSU9OIChkZWNpc2lvbik7CisJV0VCS0lUX05BV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8gdGhlIEMgY2FsbGJhY2sKICAgICAgcHJvY2VkdXJl IHRoYXQgcmV0cmlldmVzIHRoZSByZXR1cm4gdmFsdWUuICAqLwogICB3ZWJraXRfd2ViX3ZpZXdf cnVuX2phdmFzY3JpcHQgKFdFQktJVF9XRUJfVklFVyAoeHctPndpZGdldF9vc3IpLAotICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgIFNTREFUQSAoc2NyaXB0KSwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICBOVUxMLCAvKiBjYW5jZWxhYmxlICovCi0gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgY2FsbGJhY2ssCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGdwb2ludGVyKSBmdW4pOworCQkJCSAgU1NEQVRBIChzY3JpcHQpLAorCQkJ CSAgTlVMTCwgLyogY2FuY2VsYWJsZSAqLworCQkJCSAgY2FsbGJhY2ssCisJCQkJICAoZ3BvaW50 ZXIpIGZ1bik7CiAgIHJldHVybiBRbmlsOwogfQogCkBAIC03NDYsMjEgKzc0NiwyMSBAQCBERUZV TiAoInh3aWRnZXQtcmVzaXplIiwgRnh3aWRnZXRfcmVzaXplLCBTeHdpZGdldF9yZXNpemUsIDMs IDMsIDAsCiAgIGlmICh4dy0+d2lkZ2V0X29zcikKICAgICB7CiAgICAgICBndGtfd2luZG93X3Jl c2l6ZSAoR1RLX1dJTkRPVyAoeHctPndpZGdldHdpbmRvd19vc3IpLCB4dy0+d2lkdGgsCi0gICAg ICAgICAgICAgICAgICAgICAgICAgeHctPmhlaWdodCk7CisJCQkgeHctPmhlaWdodCk7CiAgICAg ICBndGtfY29udGFpbmVyX3Jlc2l6ZV9jaGlsZHJlbiAoR1RLX0NPTlRBSU5FUiAoeHctPndpZGdl dHdpbmRvd19vc3IpKTsKICAgICAgIGd0a193aWRnZXRfc2V0X3NpemVfcmVxdWVzdCAoR1RLX1dJ REdFVCAoeHctPndpZGdldF9vc3IpLCB4dy0+d2lkdGgsCi0gICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIHh3LT5oZWlnaHQpOworCQkJCSAgIHh3LT5oZWlnaHQpOwogICAgIH0KIAog ICBmb3IgKExpc3BfT2JqZWN0IHRhaWwgPSBWeHdpZGdldF92aWV3X2xpc3Q7IENPTlNQICh0YWls KTsgdGFpbCA9IFhDRFIgKHRhaWwpKQogICAgIHsKICAgICAgIGlmIChYV0lER0VUX1ZJRVdfUCAo WENBUiAodGFpbCkpKQotICAgICAgICB7Ci0gICAgICAgICAgc3RydWN0IHh3aWRnZXRfdmlldyAq eHYgPSBYWFdJREdFVF9WSUVXIChYQ0FSICh0YWlsKSk7Ci0gICAgICAgICAgaWYgKFhYV0lER0VU ICh4di0+bW9kZWwpID09IHh3KQotICAgICAgICAgICAgICBndGtfd2lkZ2V0X3NldF9zaXplX3Jl cXVlc3QgKEdUS19XSURHRVQgKHh2LT53aWRnZXQpLCB4dy0+d2lkdGgsCi0gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgeHctPmhlaWdodCk7Ci0gICAgICAgIH0KKwl7 CisJICBzdHJ1Y3QgeHdpZGdldF92aWV3ICp4diA9IFhYV0lER0VUX1ZJRVcgKFhDQVIgKHRhaWwp KTsKKwkgIGlmIChYWFdJREdFVCAoeHYtPm1vZGVsKSA9PSB4dykKKwkgICAgICBndGtfd2lkZ2V0 X3NldF9zaXplX3JlcXVlc3QgKEdUS19XSURHRVQgKHh2LT53aWRnZXQpLCB4dy0+d2lkdGgsCisJ CQkJCSAgIHh3LT5oZWlnaHQpOworCX0KICAgICB9CiAKICAgcmV0dXJuIFFuaWw7CkBAIC04NjMs OSArODYzLDkgQEAgREVGVU4gKCJkZWxldGUteHdpZGdldC12aWV3IiwKICAgLyogeHYtPm1vZGVs IHN0aWxsIGhhcyBzaWduYWxzIHBvaW50aW5nIHRvIHRoZSB2aWV3LiAgVGhlcmUgY2FuIGJlCiAg ICAgIHNldmVyYWwgdmlld3MuICBGaW5kIHRoZSBtYXRjaGluZyBzaWduYWxzIGFuZCBkZWxldGUg dGhlbSBhbGwuICAqLwogICBnX3NpZ25hbF9oYW5kbGVyc19kaXNjb25uZWN0X21hdGNoZWQgIChY WFdJREdFVCAoeHYtPm1vZGVsKS0+d2lkZ2V0d2luZG93X29zciwKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgR19TSUdOQUxfTUFUQ0hfREFUQSwKLSAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMCwgMCwgMCwgMCwKLSAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgeHYtPndpZGdldCk7CisJCQkJCSBHX1NJR05BTF9N QVRDSF9EQVRBLAorCQkJCQkgMCwgMCwgMCwgMCwKKwkJCQkJIHh2LT53aWRnZXQpOwogICByZXR1 cm4gUW5pbDsKIH0KIApAQCAtODg4LDggKzg4OCw4IEBAIFJldHVybiBuaWwgaWYgbm8gYXNzb2Np YXRpb24gaXMgZm91bmQuICAqLykKICAgICB7CiAgICAgICBMaXNwX09iamVjdCB4d2lkZ2V0X3Zp ZXcgPSBYQ0FSICh0YWlsKTsKICAgICAgIGlmIChFUSAoRnh3aWRnZXRfdmlld19tb2RlbCAoeHdp ZGdldF92aWV3KSwgeHdpZGdldCkKLSAgICAgICAgICAmJiBFUSAoRnh3aWRnZXRfdmlld193aW5k b3cgKHh3aWRnZXRfdmlldyksIHdpbmRvdykpCi0gICAgICAgIHJldHVybiB4d2lkZ2V0X3ZpZXc7 CisJICAmJiBFUSAoRnh3aWRnZXRfdmlld193aW5kb3cgKHh3aWRnZXRfdmlldyksIHdpbmRvdykp CisJcmV0dXJuIHh3aWRnZXRfdmlldzsKICAgICB9CiAKICAgcmV0dXJuIFFuaWw7CkBAIC05OTcs MTEgKzk5NywxMSBAQCBzeW1zX29mX3h3aWRnZXQgKHZvaWQpCiAgIERFRlNZTSAoUUNwbGlzdCwg IjpwbGlzdCIpOwogCiAgIERFRlZBUl9MSVNQICgieHdpZGdldC1saXN0IiwgVnh3aWRnZXRfbGlz dCwKLSAgICAgICAgICAgICAgIGRvYzoJLyogeHdpZGdldHMgbGlzdC4gICovKTsKKwkgICAgICAg ZG9jOgkvKiB4d2lkZ2V0cyBsaXN0LiAgKi8pOwogICBWeHdpZGdldF9saXN0ID0gUW5pbDsKIAog ICBERUZWQVJfTElTUCAoInh3aWRnZXQtdmlldy1saXN0IiwgVnh3aWRnZXRfdmlld19saXN0LAot ICAgICAgICAgICAgIGRvYzoJLyogeHdpZGdldCB2aWV3cyBsaXN0LiAgKi8pOworCSAgICAgZG9j OgkvKiB4d2lkZ2V0IHZpZXdzIGxpc3QuICAqLyk7CiAgIFZ4d2lkZ2V0X3ZpZXdfbGlzdCA9IFFu aWw7CiAKICAgRnByb3ZpZGUgKGludGVybiAoInh3aWRnZXQtaW50ZXJuYWwiKSwgUW5pbCk7CkBA IC0xMDQ5LDEzICsxMDQ5LDEzIEBAIHh3aWRnZXRfdmlld19kZWxldGVfYWxsX2luX3dpbmRvdyAo c3RydWN0IHdpbmRvdyAqdykKICAgICAgICB0YWlsID0gWENEUiAodGFpbCkpCiAgICAgewogICAg ICAgaWYgKFhXSURHRVRfVklFV19QIChYQ0FSICh0YWlsKSkpCi0gICAgICAgIHsKLSAgICAgICAg ICB4diA9IFhYV0lER0VUX1ZJRVcgKFhDQVIgKHRhaWwpKTsKLSAgICAgICAgICBpZiAoWFdJTkRP VyAoeHYtPncpID09IHcpCi0gICAgICAgICAgICB7Ci0gICAgICAgICAgICAgIEZkZWxldGVfeHdp ZGdldF92aWV3IChYQ0FSICh0YWlsKSk7Ci0gICAgICAgICAgICB9Ci0gICAgICAgIH0KKwl7CisJ ICB4diA9IFhYV0lER0VUX1ZJRVcgKFhDQVIgKHRhaWwpKTsKKwkgIGlmIChYV0lORE9XICh4di0+ dykgPT0gdykKKwkgICAgeworCSAgICAgIEZkZWxldGVfeHdpZGdldF92aWV3IChYQ0FSICh0YWls KSk7CisJICAgIH0KKwl9CiAgICAgfQogfQogCkBAIC0xMDk0LDcgKzEwOTQsNyBAQCB4d2lkZ2V0 X3N0YXJ0X3JlZGlzcGxheSAodm9pZCkKICAgICAgICB0YWlsID0gWENEUiAodGFpbCkpCiAgICAg ewogICAgICAgaWYgKFhXSURHRVRfVklFV19QIChYQ0FSICh0YWlsKSkpCi0gICAgICAgIFhYV0lE R0VUX1ZJRVcgKFhDQVIgKHRhaWwpKS0+cmVkaXNwbGF5ZWQgPSBmYWxzZTsKKwlYWFdJREdFVF9W SUVXIChYQ0FSICh0YWlsKSktPnJlZGlzcGxheWVkID0gZmFsc2U7CiAgICAgfQogfQogCkBAIC0x MTU3LDE5ICsxMTU3LDE5IEBAIHh3aWRnZXRfZW5kX3JlZGlzcGxheSAoc3RydWN0IHdpbmRvdyAq dywgc3RydWN0IGdseXBoX21hdHJpeCAqbWF0cml4KQogICAgICAgIHRhaWwgPSBYQ0RSICh0YWls KSkKICAgICB7CiAgICAgICBpZiAoWFdJREdFVF9WSUVXX1AgKFhDQVIgKHRhaWwpKSkKLSAgICAg ICAgewotICAgICAgICAgIHN0cnVjdCB4d2lkZ2V0X3ZpZXcgKnh2ID0gWFhXSURHRVRfVklFVyAo WENBUiAodGFpbCkpOwotCi0gICAgICAgICAgLyogInRvdWNoZWQiIGlzIG9ubHkgbWVhbmluZ2Z1 bCBmb3IgdGhlIGN1cnJlbnQgd2luZG93LCBzbwotICAgICAgICAgICAgIGRpc3JlZ2FyZCBvdGhl ciB2aWV3cy4gICovCi0gICAgICAgICAgaWYgKFhXSU5ET1cgKHh2LT53KSA9PSB3KQotICAgICAg ICAgICAgewotICAgICAgICAgICAgICBpZiAoeHdpZGdldF90b3VjaGVkICh4dikpCi0gICAgICAg ICAgICAgICAgeHdpZGdldF9zaG93X3ZpZXcgKHh2KTsKLSAgICAgICAgICAgICAgZWxzZQotICAg ICAgICAgICAgICAgIHh3aWRnZXRfaGlkZV92aW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