You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

#### 54 lines 1.4 KiB Diff Raw Blame History

 ```From 5852b85eaa174dfb87ce7a03b9f70e2bffac4ca4 Mon Sep 17 00:00:00 2001 ``` ```From: Laszlo Ersek ``` ```Date: Wed, 29 Jun 2022 15:44:27 +0200 ``` ```Subject: [PATCH] update common submodule for CVE-2022-2211 fix ``` ``` ``` ```\$ git shortlog 9e990f3e4530..35467027f657 ``` ``` ``` ```Laszlo Ersek (1): ``` ``` options: fix buffer overflow in get_keys() [CVE-2022-2211] ``` ``` ``` ```Signed-off-by: Laszlo Ersek ``` ```(cherry picked from commit 795d5dfcef77fc54fec4d237bda28571454a6d4e) ``` ```--- ``` ``` common | 2 +- ``` ``` 1 file changed, 1 insertion(+), 1 deletion(-) ``` ``` ``` ```Submodule common be09523d..1174b443: ``` ```diff --git a/common/options/keys.c b/common/options/keys.c ``` ```index 798315c..d27a712 100644 ``` ```--- a/common/options/keys.c ``` ```+++ b/common/options/keys.c ``` ```@@ -128,17 +128,23 @@ read_first_line_from_file (const char *filename) ``` ``` char ** ``` ``` get_keys (struct key_store *ks, const char *device, const char *uuid) ``` ``` { ``` ```- size_t i, j, len; ``` ```+ size_t i, j, nmemb; ``` ``` char **r; ``` ``` char *s; ``` ``` ``` ``` /* We know the returned list must have at least one element and not ``` ``` * more than ks->nr_keys. ``` ``` */ ``` ```- len = 1; ``` ```- if (ks) ``` ```- len = MIN (1, ks->nr_keys); ``` ```- r = calloc (len+1, sizeof (char *)); ``` ```+ nmemb = 1; ``` ```+ if (ks && ks->nr_keys > nmemb) ``` ```+ nmemb = ks->nr_keys; ``` ```+ ``` ```+ /* make room for the terminating NULL */ ``` ```+ if (nmemb == (size_t)-1) ``` ```+ error (EXIT_FAILURE, 0, _("size_t overflow")); ``` ```+ nmemb++; ``` ```+ ``` ```+ r = calloc (nmemb, sizeof (char *)); ``` ``` if (r == NULL) ``` ``` error (EXIT_FAILURE, errno, "calloc"); ``` ``` ``` ```-- ``` ```2.31.1 ``` ``` ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.5246495,"math_prob":0.68120605,"size":1689,"snap":"2023-14-2023-23","text_gpt3_token_len":609,"char_repetition_ratio":0.10385757,"word_repetition_ratio":0.0068259384,"special_character_ratio":0.45293072,"punctuation_ratio":0.19805194,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9516817,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-06-04T23:29:44Z\",\"WARC-Record-ID\":\"<urn:uuid:46e1e4a4-4f03-4152-b6c3-a8ea8d02f3ac>\",\"Content-Length\":\"50315\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d643b6da-4900-4bf8-98c2-917c02b973f6>\",\"WARC-Concurrent-To\":\"<urn:uuid:69ee83bf-e25b-4358-aa63-e46a4d2c2206>\",\"WARC-IP-Address\":\"20.88.192.251\",\"WARC-Target-URI\":\"https://git.almalinux.org/rpms/virt-v2v/src/commit/b10c838fd98fd61cd3a6e5cb68e7c6d0e7317af5/SOURCES/0052-update-common-submodule-for-CVE-2022-2211-fix.patch\",\"WARC-Payload-Digest\":\"sha1:NIE3MUYXJRARZYRMLHUNF3OYY2HIY7GT\",\"WARC-Block-Digest\":\"sha1:7MUIU3KZCKK4J5ET2PCB7LQJ45LYRO2G\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-23/CC-MAIN-2023-23_segments_1685224650409.64_warc_CC-MAIN-20230604225057-20230605015057-00013.warc.gz\"}"}