Commit Graph

69 Commits

Author SHA1 Message Date
Ralph Holmes 5d774cce1d Fix execl(3) sentinel undefined behaviour.
execl(3) and its variants use a sentinel to terminate the variadic
argument list, in the form of a null pointer constant of type pointer to
char. POSIX mandates that NULL is a null pointer constant of type
pointer to void, which is not of an equivalent type to that required by
execl(3) and its variants, resulting in undefined behaviour.

This commit casts all such instances of NULL to pointer to char type.
For consistency, it also adds const-qualification to any such instances
which had already been casted, and were not const-qualified.
2016-09-30 23:36:49 +02:00
Jonas 'Sortie' Termansen f6cc06fbd1 Fix bsearch(3) performance. 2016-05-15 19:30:51 +02:00
Jonas 'Sortie' Termansen 2b72262b4f Relicense Sortix to the ISC license.
I hereby relicense all my work on Sortix under the ISC license as below.

All Sortix contributions by other people are already under this license,
are not substantial enough to be copyrightable, or have been removed.

All imported code from other projects is compatible with this license.

All GPL licensed code from other projects had previously been removed.

Copyright 2011-2016 Jonas 'Sortie' Termansen and contributors.

Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
2016-03-05 22:21:50 +01:00
Jonas 'Sortie' Termansen 01b59c1947 Convert libc to C. 2016-03-03 23:02:23 +01:00
Jonas 'Sortie' Termansen 4f07e94b0c Rewrite strtof(3). 2016-02-29 01:37:30 +01:00
Jonas 'Sortie' Termansen 2ab9139f35 Fix missing malloc check in canonicalize_file_name_at(3). 2016-02-18 22:15:17 +01:00
Jonas 'Sortie' Termansen 7a7ddc2d73 Add guard page debug malloc. 2016-01-26 22:48:40 +01:00
Jonas 'Sortie' Termansen 4d2901b90e Split stdin, stdout and stderr into their own files. 2016-01-26 19:01:36 +01:00
Jonas 'Sortie' Termansen 2e4b15daed Simplify directory reading. 2016-01-26 18:42:54 +01:00
Jonas 'Sortie' Termansen 4b6b06bbc8 Add scram(2). 2015-12-12 22:53:07 +01:00
Jonas 'Sortie' Termansen 8a653584c4 Fix strtol multiplication overflow check. 2015-10-11 23:25:21 +02:00
Jonas 'Sortie' Termansen 59e7dd00c5 Add mkdtemps(3). 2015-08-26 16:49:18 +02:00
Jonas 'Sortie' Termansen 6405e2ea6e Add arc4random support to the kernel. 2015-08-22 01:04:58 +02:00
Jonas 'Sortie' Termansen 13e8e092a6 Fix mkostemps and mkdtemp not restoring X's on error. 2015-06-27 17:06:43 +02:00
Jonas 'Sortie' Termansen 8c0252300e Fix strtol isspace calls. 2015-05-15 16:18:41 +02:00
Jonas 'Sortie' Termansen 25482f875e Remove mktemp(3). 2015-04-13 00:00:29 +02:00
Jonas 'Sortie' Termansen 60f85af7c4 Fix strtol multiplication overflow check. 2015-02-11 17:35:28 +01:00
Jonas 'Sortie' Termansen 8cd4c1f5a0 Add mkdtemp(3). 2015-02-09 18:56:14 +01:00
Jonas 'Sortie' Termansen f0e3e2cfef Add mkostemps(3) family. 2015-02-09 18:56:14 +01:00
Jonas 'Sortie' Termansen 261b95e0a6 Add reallocarray(3). 2014-12-03 23:55:55 +01:00
Jonas 'Sortie' Termansen 74247eb71e Rewrite malloc(3). 2014-12-03 21:32:50 +01:00
Jonas 'Sortie' Termansen fb8221a381 Improve mkstemp(3) random path generation. 2014-12-01 23:22:11 +01:00
Jonas 'Sortie' Termansen 35708fa900 Retire calltrace support in favor of the kernel debugger. 2014-12-01 21:38:06 +01:00
Jonas 'Sortie' Termansen c24b5ee5a4 Lazily close files in exit(3). 2014-12-01 18:54:41 +01:00
Jonas 'Sortie' Termansen a25f1a931e Initialize stdin, stdout and stderr at compile time. 2014-12-01 18:45:11 +01:00
Jonas 'Sortie' Termansen 9fec909970 Indirectly closedir(3) from exit(3). 2014-12-01 18:45:10 +01:00
Jonas 'Sortie' Termansen 5e60007904 Remove dcloseall() and fcloseall(). 2014-12-01 16:29:43 +01:00
Jonas 'Sortie' Termansen edb19f2394 Add arc4random(3). 2014-11-28 13:35:51 +01:00
Jonas 'Sortie' Termansen a1e9c15bca Add wcstof(3), wcstod(3) and wcstold(3). 2014-11-26 22:49:00 +01:00
Jonas 'Sortie' Termansen 749d123331 Maintain counts of physical frames used for particular purposes. 2014-11-26 22:27:04 +01:00
Jonas 'Sortie' Termansen 5f2106f512 Maintain size of allocated memory in the heap. 2014-11-26 22:25:37 +01:00
Jonas 'Sortie' Termansen f41964fcab Reimplement wchar conversion API. 2014-11-24 17:41:26 +01:00
Jonas 'Sortie' Termansen 5dbd89d2aa Delay heap initialization until first heap expansion. 2014-11-20 21:09:14 +01:00
Jonas 'Sortie' Termansen f3eb87c3ee Improve qsort_r(3) run-time complexity using quicksort. 2014-09-25 18:20:00 +02:00
Jonas 'Sortie' Termansen a9cf3cc684 Add qsort_r(3). 2014-09-25 18:20:00 +02:00
Jonas 'Sortie' Termansen 94a7433cf0 Fix atoi(3) out-of-range cases. 2014-09-25 17:27:54 +02:00
Jonas 'Sortie' Termansen 87fee95949 Fix setenv(3) error case. 2014-09-25 17:27:54 +02:00
Jonas 'Sortie' Termansen 513c5f242d Fix strtol(3) quality. 2014-09-25 17:27:54 +02:00
Jonas 'Sortie' Termansen b75678bcab Fix mkstemp(3) creating files with an insecure mode. 2014-08-23 21:47:04 +02:00
Jonas 'Sortie' Termansen 74fbbb3c78 Fix mkstemp(3) not rejecting bad templates.
Found by musl's libc-test.
2014-08-23 21:47:04 +02:00
Jonas 'Sortie' Termansen 40fd0fa3dc Fix the environment functions not rejecting the empty name.
Found by musl's libc-test.
2014-08-23 21:47:04 +02:00
Jonas 'Sortie' Termansen 0adfceef87 Fix strtol("0xz", &s, 16) handling.
Found by musl's libc-test.
2014-08-23 21:47:04 +02:00
Jonas 'Sortie' Termansen a8b8514272 Fix clearenv(3) leaving internal pointer alive after free.
This causes use-after-free and double-free bugs when other environment
functions are subsequently called.
2014-08-23 21:04:39 +02:00
Jonas 'Sortie' Termansen 5f9da2a651 Fix format string problems in error(3) calls. 2014-08-23 21:04:39 +02:00
Jonas 'Sortie' Termansen 30cd318c17 Implement signals.
Note: This is an incompatible ABI change.
2014-07-22 13:25:39 +02:00
Jonas 'Sortie' Termansen a1ccba00f7 Thread-secure rand(3). 2014-07-08 17:41:52 +02:00
Jonas 'Sortie' Termansen e1db06c1c9 Thread-secure exit(3). 2014-07-08 17:41:52 +02:00
Jonas 'Sortie' Termansen a96aca09c1 Thread-secure user-space heap. 2014-07-08 17:41:52 +02:00
Jonas 'Sortie' Termansen 534eb3ddd8 Fix libk being built with -mmmx, -msse and -msse2 on x86_64. 2014-05-28 17:42:19 +02:00
Jonas 'Sortie' Termansen 73cea916d9 Fix suboptimal heap chunk spliting. 2014-05-16 14:48:27 +02:00