OpenBSD CVS

CVS log for src/bin/ksh/alloc.c


[BACK] Up to [local] / src / bin / ksh

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.19 / (download) - annotate - [select for diffs], Tue Jan 16 22:52:32 2018 UTC (6 years, 4 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, OPENBSD_6_5_BASE, OPENBSD_6_5, OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, HEAD
Changes since 1.18: +6 -6 lines
Diff to previous 1.18 (colored)

Introduce internal_warningf() and mark internal_errorf() as noreturn

This helps tools like scan-build, and follows the example of warningf()
and errorf().  ok anton@

Revision 1.18 / (download) - annotate - [select for diffs], Thu Nov 2 06:55:35 2017 UTC (6 years, 7 months ago) by tb
Branch: MAIN
Changes since 1.17: +2 -2 lines
Diff to previous 1.17 (colored)

Switch calloc(3) back to malloc(3).  The call to calloc was introduced
by the plaintext history diff, but the code that may have depended on
this was since removed from history.c.  None of the code introduced
between the plaintext history commit and now depends on calloc(3).
This way we can again use malloc.conf(5)'s J option to recognize use
of uninitialized memory.

ok jca

Revision 1.17 / (download) - annotate - [select for diffs], Tue Aug 15 17:57:57 2017 UTC (6 years, 9 months ago) by jca
Branch: MAIN
CVS Tags: OPENBSD_6_2_BASE, OPENBSD_6_2
Changes since 1.16: +2 -10 lines
Diff to previous 1.16 (colored)

Remove expensive pointer check in afree()

The check added in rev 1.8 walks the whole freelist to catch cases where
an unknown pointer is passed to afree(); but it can't catch cases
whether the struct link has been corrupted by an invalid memory write.
And it becomes very expensive when you have lots of items in an area
(for example with a huge HISTSIZE).

Discussed with & ok millert@ tb@

Revision 1.16 / (download) - annotate - [select for diffs], Mon May 29 13:09:17 2017 UTC (7 years ago) by tb
Branch: MAIN
Changes since 1.15: +2 -2 lines
Diff to previous 1.15 (colored)

Change the mmap(2)-based binary history file with lots of magic and a
tendency for corruption to a simpler plaintext version.

To convert your current ksh history to plaintext, issue

	fc -ln 1 | sed 's/^	//' > ~/ksh_hist.txt

before upgrading and use ksh_hist.txt as HISTFILE after the upgrade.

Original patch by marco in 2011. Ported to current during g2k16 by me.
Testing, bugfixes and improvements in joint work with natano.

Additional testing by anton and mestre. Includes some tweaks by anton.
Committing now to shake out remaining bugs before 6.2 is cut.

ok deraadt, mestre, anton, sthen

Revision 1.15 / (download) - annotate - [select for diffs], Wed Jun 1 10:29:20 2016 UTC (8 years ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_6_1_BASE, OPENBSD_6_1, OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.14: +3 -25 lines
Diff to previous 1.14 (colored)

put this in the public domain as well. reminded by theo. we discussed
this before previous release, and I plain forgot about it.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Dec 14 13:59:42 2015 UTC (8 years, 5 months ago) by tb
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.13: +2 -1 lines
Diff to previous 1.13 (colored)

Move system headers from sh.h to those files that actually need them.

ok mmcc@ a while ago

Revision 1.13 / (download) - annotate - [select for diffs], Mon Oct 19 02:15:45 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.12: +2 -1 lines
Diff to previous 1.12 (colored)

Apply style(9) to header includes.

ok nicm@

Revision 1.12 / (download) - annotate - [select for diffs], Sat Oct 17 13:32:46 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.11: +3 -3 lines
Diff to previous 1.11 (colored)

Change allocarray() to areallocarray(), a full reallocarray clone. All
the logic is already in aresize().

"Sure" nicm@

Revision 1.11 / (download) - annotate - [select for diffs], Sat Oct 17 13:27:55 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.10: +5 -1 lines
Diff to previous 1.10 (colored)

Copy alloc()'s overflow check to aresize().

Suggested by nicm@.

Revision 1.10 / (download) - annotate - [select for diffs], Fri Oct 16 23:13:35 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)

Move the overflow check to alloc() so that the link struct overhead can
never bite us.

Suggested by Theo Buehler, inspired by Bitrig's natano@.

ok tedu@

Revision 1.9 / (download) - annotate - [select for diffs], Fri Oct 16 03:17:56 2015 UTC (8 years, 7 months ago) by mmcc
Branch: MAIN
Changes since 1.8: +26 -1 lines
Diff to previous 1.8 (colored)

Add allocarray(), an overflow-safe allocation function.

We avoided reallocation support because it demands more fancy footwork
to deal with the prepended link struct.

This has been on my mind for a while, and a 2010 security review of mksh
by the Android security team's Chris Palmer suggested it.

ok nicm@. Also discussed with millert@ and tedu@.

Revision 1.8 / (download) - annotate - [select for diffs], Mon Jul 21 17:30:08 2008 UTC (15 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8, OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5, OPENBSD_5_4_BASE, OPENBSD_5_4, OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8, OPENBSD_4_7_BASE, OPENBSD_4_7, OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.7: +9 -2 lines
Diff to previous 1.7 (colored)

Extra sanity checking for afree();  OK deraadt@ and pvalchev@

Revision 1.7 / (download) - annotate - [select for diffs], Thu Feb 19 18:51:17 2004 UTC (20 years, 3 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9, OPENBSD_3_8_BASE, OPENBSD_3_8, OPENBSD_3_7_BASE, OPENBSD_3_7, OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5
Changes since 1.6: +6 -6 lines
Diff to previous 1.6 (colored)

basic knf

Revision 1.6 / (download) - annotate - [select for diffs], Tue Aug 5 20:52:27 2003 UTC (20 years, 10 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.5: +12 -11 lines
Diff to previous 1.5 (colored)

Don't allow alloc() and aresize() to fail.  Their return value was
only checked in two place (both in conjunction with str_save).  Upon
malloc/realloc failure we call internal_errorf() which pops throws
and error and pops back to the last good state.  OK deraadt@ pval@ fgs@
Original problem noted by mickey@

Revision 1.5 / (download) - annotate - [select for diffs], Fri Mar 1 13:06:18 2002 UTC (22 years, 3 months ago) by espie
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.4: +77 -736 lines
Diff to previous 1.4 (colored)

Kill hand-made memory allocation code, that is definitely buggy.
Replace with simple wrapper around malloc, at least this works,
and it's easier to debug anyways.

Revision 1.4 / (download) - annotate - [select for diffs], Wed Jul 14 13:37:23 1999 UTC (24 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0, OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7, OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.3: +2 -2 lines
Diff to previous 1.3 (colored)

pdksh-5.2.14

Revision 1.3 / (download) - annotate - [select for diffs], Mon Jun 29 20:06:19 1998 UTC (25 years, 11 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5, OPENBSD_2_4_BASE, OPENBSD_2_4
Changes since 1.2: +2 -2 lines
Diff to previous 1.2 (colored)

overflow fix; michael@cs.mun.ca

Revision 1.2 / (download) - annotate - [select for diffs], Thu Jun 25 19:01:43 1998 UTC (25 years, 11 months ago) by millert
Branch: MAIN
Changes since 1.1: +595 -105 lines
Diff to previous 1.1 (colored)

pdksh-5.2.13 + local changes

Revision 1.1.1.1 / (download) - annotate - [select for diffs] (vendor branch), Wed Aug 14 06:19:10 1996 UTC (27 years, 10 months ago) by downsj
Branch: pdksh
CVS Tags: pdksh-527, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.1: +0 -0 lines
Diff to previous 1.1 (colored)

Import pdksh 5.2.7.

Revision 1.1 / (download) - annotate - [select for diffs], Wed Aug 14 06:19:10 1996 UTC (27 years, 10 months ago) by downsj
Branch: MAIN

Initial revision

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.