Tcl Source Code

Check-in [02693d92df]
Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to tclconference@googlegroups.com
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:cherry-pick [3e4d907d8e] from 8.6: prevent buffer overrun in fast_s_mp_mul_digs().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | core-8-5-branch
Files: files | file ages | folders
SHA3-256:02693d92df2690a3ba4f6ad3bdf7bec39f638654465ac292a0031422997ffe40
User & Date: sebres 2019-01-07 01:11:32
Context
2019-01-25
13:43
Do not assume that literals have a non-NULL bytes field; user code could purge it. check-in: da7b45afb4 user: dkf tags: core-8-5-branch
2019-01-07
01:15
merge back after cherry-picking (no functional changes) check-in: 6a6a71e5bf user: sebres tags: core-8-6-branch
01:11
cherry-pick [3e4d907d8e] from 8.6: prevent buffer overrun in fast_s_mp_mul_digs(). check-in: 02693d92df user: sebres tags: core-8-5-branch
2019-01-04
22:29
Update TZ info to tzdata2018i. check-in: cf6870f4f3 user: jan.nijtmans tags: core-8-5-branch
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to libtommath/bn_fast_s_mp_mul_digs.c.

83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  /* setup dest */
  olduse  = c->used;
  c->used = pa;

  {
    register mp_digit *tmpc;
    tmpc = c->dp;
    for (ix = 0; ix < pa+1; ix++) {
      /* now extract the previous digit [below the carry] */
      *tmpc++ = W[ix];
    }

    /* clear unused digits [that existed in the old copy of c] */
    for (; ix < olduse; ix++) {
      *tmpc++ = 0;
    }
  }
  mp_clamp (c);
  return MP_OKAY;
}
#endif







|













83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
  /* setup dest */
  olduse  = c->used;
  c->used = pa;

  {
    register mp_digit *tmpc;
    tmpc = c->dp;
    for (ix = 0; ix < pa; ix++) {
      /* now extract the previous digit [below the carry] */
      *tmpc++ = W[ix];
    }

    /* clear unused digits [that existed in the old copy of c] */
    for (; ix < olduse; ix++) {
      *tmpc++ = 0;
    }
  }
  mp_clamp (c);
  return MP_OKAY;
}
#endif