Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1thtLc-0088a6-2d for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 16:42:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1thtLa-00CoP8-Ng for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Feb 2025 16:42:54 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1thm0Q-008vex-HO for pgsql-hackers@lists.postgresql.org; Tue, 11 Feb 2025 08:52:34 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1thm0N-000BS2-2s for pgsql-hackers@postgresql.org; Tue, 11 Feb 2025 08:52:33 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mx2023; t=1739263949; bh=fGgd72AZnshuHwwAz/4VyoDt+1J2VHkKD2s8Wag8C7Q=; h=From:Date:To:Message-ID:Subject:User-Agent:From; b=ZyuEMmCMqMiOqymk5E0FMaVzVBC3CixRJDvy7uKfwsuCw+v3PlJT85yhOtyLi2iE8 VbBIqUx16Vk0Ody6yfofFDoN95zQIfXcIVVNcqxi3ojzpB9Fil91Wfd7dG/Etu1+4D vaCatX0S4xHL6oEjKibWdvXwq1zROr5oaoghxAEP1jwyBlIGL1C1vtfpD+M+vpr4GS Pxx0Y+uzp1eLHY8tnD7sHGSiMPQIert2mwmmJFMUx0hyO/gdW4ctPY8BykSTJRdkmh U/PE8mEwA2i4u5aq3LPk4SWqZWFCXbRNXz8Ywks5irhg2PBLHDpxIPbxzGXjO3vyZW BGtZiOB7dWHWQ== Received: from sogo.postgrespro.ru (sogo.l.postgrespro.ru [192.168.2.5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by mail.postgrespro.ru (Postfix/587) with ESMTPS id 20FB660858 for ; Tue, 11 Feb 2025 11:52:29 +0300 (MSK) From: =?utf-8?q?=D0=9A=D0=BE=D1=80=D0=BE=D1=82=D0=BA=D0=BE=D0=B2_=D0=9C=D0=B0=D0=BA=D1=81=D0=B8=D0=BC?= Content-Type: multipart/mixed; boundary="----=_=-_OpenGroupware_org_NGMime-1907270-1739263949.011555-5------" X-Forward: 82.208.125.159 Date: Tue, 11 Feb 2025 11:52:29 +0300 To: pgsql-hackers@postgresql.org MIME-Version: 1.0 Message-ID: <1d1a46-67ab1000-21-80c451@83151435> Subject: [PATCH] =?utf-8?q?snowball=3A?= fix potential NULL dereference User-Agent: SOGoMail 5.11.2 X-KSMG-AntiPhishing: NotDetected X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.1.0.7854, bases: 2025/02/11 06:37:00 #27149323 X-KSMG-AntiVirus-Status: NotDetected, skipped X-KSMG-LinksScanning: not scanned, disabled by settings X-KSMG-Message-Action: skipped X-KSMG-Rule-ID: 1 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk ------=_=-_OpenGroupware_org_NGMime-1907270-1739263949.011555-5------ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Content-Length: 454 Hi all, I found the case of potential NULL pointer dereference. In snowball/libstemmer/api.c if we transfer control to the SN=5Fcreate=5F= env() function by using the error label when there is a memory allocation error of z->= p or z->S, we can then dereference the NULL pointer z->S in the function SN=5Fclos= e=5Fenv(). Added the pointer check for avoiding a potential problem. --- Best regards, Korotkov Maksim PostgresPro m.korotkov@postgrespro.ru ------=_=-_OpenGroupware_org_NGMime-1907270-1739263949.011555-5------ Content-Type: text/x-patch Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="0001-snowball-fix-potential-NULL-dereference.patch" Content-Length: 1824 RnJvbSBjNDU5NmY2ZTIzYzRmNWU5YWU4Mjk0ZDUxNzgzYWZiNzMzZWNjYzlkIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBNYWtzaW0gS29yb3Rrb3YgPG0ua29yb3Rrb3ZAcG9z dGdyZXNwcm8ucnU+CkRhdGU6IFR1ZSwgMjQgRGVjIDIwMjQgMTc6MDc6MTIgKzAzMDAKU3Vi amVjdDogW1BBVENIXSBzbm93YmFsbDogZml4IHBvdGVudGlhbCBOVUxMIGRlcmVmZXJlbmNl CgpJZiB3ZSB0cmFuc2ZlciBjb250cm9sIHRvIHRoZSBTTl9jcmVhdGVfZW52KCkgZnVuY3Rp b24gYnkgdXNpbmcgdGhlIGVycm9yCmxhYmVsIHdoZW4gdGhlcmUgaXMgYSBtZW1vcnkgYWxs b2NhdGlvbiBlcnJvciBvZiB6LT5wIG9yIHotPlMsCndlIGNhbiB0aGVuIGRlcmVmZXJlbmNl IHRoZSBOVUxMIHBvaW50ZXIgei0+UyBpbiB0aGUgZnVuY3Rpb24gU05fY2xvc2VfZW52KCku CkFkZGVkIHRoZSBwb2ludGVyIGNoZWNrIGZvciBhdm9pZGluZyBwb3RlbnRpYWwgcHJvYmxl bS4KCkZpeGVzOiAxNDBkNGViY2I0ICgiVHNlYXJjaDIgZnVuY3Rpb25hbGl0eSBtaWdyYXRl cyB0byBjb3JlLiAgVGhlIGJ1bGsgb2YgdGhpcyB3b3JrIGlzIGJ5IE9sZWcgQmFydHVub3Yg YW5kIFRlb2RvciBTaWdhZXYsIGJ1dCBJIGRpZCBhIGxvdCBvZiBlZGl0b3JpYWxpemluZywg c28gYW55dGhpbmcgdGhhdCdzIGJyb2tlbiBpcyBwcm9iYWJseSBteSBmYXVsdC4iKQoKRm91 bmQgYnkgUG9zdGdyZXMgUHJvIHdpdGggU3ZhY2Ugc3RhdGljIGFuYWx5emVyClNpZ25lZC1v ZmYtYnk6IE1ha3NpbSBLb3JvdGtvdiA8bS5rb3JvdGtvdkBwb3N0Z3Jlc3Byby5ydT4KLS0t CiBzcmMvYmFja2VuZC9zbm93YmFsbC9saWJzdGVtbWVyL2FwaS5jIHwgMiArLQogMSBmaWxl IGNoYW5nZWQsIDEgaW5zZXJ0aW9uKCspLCAxIGRlbGV0aW9uKC0pCgpkaWZmIC0tZ2l0IGEv c3JjL2JhY2tlbmQvc25vd2JhbGwvbGlic3RlbW1lci9hcGkuYyBiL3NyYy9iYWNrZW5kL3Nu b3diYWxsL2xpYnN0ZW1tZXIvYXBpLmMKaW5kZXggMzc1OTM4ZTZkMS4uM2E3MTY5YWJkOCAx MDA2NDQKLS0tIGEvc3JjL2JhY2tlbmQvc25vd2JhbGwvbGlic3RlbW1lci9hcGkuYworKysg Yi9zcmMvYmFja2VuZC9zbm93YmFsbC9saWJzdGVtbWVyL2FwaS5jCkBAIC0zNCw3ICszNCw3 IEBAIGVycm9yOgogZXh0ZXJuIHZvaWQgU05fY2xvc2VfZW52KHN0cnVjdCBTTl9lbnYgKiB6 LCBpbnQgU19zaXplKQogewogICAgIGlmICh6ID09IE5VTEwpIHJldHVybjsKLSAgICBpZiAo U19zaXplKQorICAgIGlmIChTX3NpemUgJiYgei0+UykKICAgICB7CiAgICAgICAgIGludCBp OwogICAgICAgICBmb3IgKGkgPSAwOyBpIDwgU19zaXplOyBpKyspCi0tIAoyLjM0LjEKCg== ------=_=-_OpenGroupware_org_NGMime-1907270-1739263949.011555-5--------