aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/pam-krb5-CVE-2020-10595.patch
blob: 4ca061230fa89fafcb2a4f582226ba3dbbf0c02d (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
Fix CVE-2020-10595:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2020-10595

Patch copied from upstream advisory:

https://seclists.org/oss-sec/2020/q1/128

diff --git a/prompting.c b/prompting.c
index e985d95..d81054f 100644
--- a/prompting.c
+++ b/prompting.c
@@ -314,26 +314,27 @@ pamk5_prompter_krb5(krb5_context context UNUSED, void *data, const char *name,
     /*
      * Reuse pam_prompts as a starting index and copy the data into the reply
      * area of the krb5_prompt structs.
      */
     pam_prompts = 0;
     if (name != NULL && !args->silent)
         pam_prompts++;
     if (banner != NULL && !args->silent)
         pam_prompts++;
     for (i = 0; i < num_prompts; i++, pam_prompts++) {
-        size_t len;
+        size_t len, allowed;

         if (resp[pam_prompts].resp == NULL)
             goto cleanup;
         len = strlen(resp[pam_prompts].resp);
-        if (len > prompts[i].reply->length)
+        allowed = prompts[i].reply->length;
+        if (allowed == 0 || len > allowed - 1)
             goto cleanup;

         /*
          * The trailing nul is not included in length, but other applications
          * expect it to be there.  Therefore, we copy one more byte than the
          * actual length of the password, but set length to just the length of
          * the password.
          */
         memcpy(prompts[i].reply->data, resp[pam_prompts].resp, len + 1);
         prompts[i].reply->length = (unsigned int) len;
Marius Bakke 2022-11-20gnu: chipmunk: Use gexps....Adam Faiz 2022-11-20gnu: chipmunk: Fix build....Adam Faiz 2022-11-15gnu: slade: Update to 3.2.1....James Smith 2022-11-06gnu: surgescript: Update to 0.5.6.1....Timotej Lazar 2022-10-25gnu: guile-chickadee: Update to 0.9.0....David Thompson 2022-10-23gnu: tsukundere: Update to 0.4.3....Liliana Marie Prikler 2022-10-22gnu: libresprite: Install a desktop icon....Andrew Whatson 2022-10-16gnu: Add dds....Nicolas Goaziou 2022-10-06gnu: python-renpy: Update to 8.0.3....Liliana Marie Prikler 2022-10-06gnu: python-pygame-sdl2: Update to 2.1.0-for-renpy-8.0.3....Liliana Marie Prikler