Enhanced safety functions
Access rate limit exceeded. Please log in to continue.
libboundscheck
Description
-
following the standard of C11 Annex K (bound-checking interfaces), functions of the common memory/string operation classes, such as memcpy_s, strcpy_s, are selected and implemented.
-
other standard functions in C11 Annex K will be analyzed in the future and implemented in this organization if necessary.
-
handles the release, update, and maintenance of bounds_checking_function.
Function List
- memcpy_s
- wmemcpy_s
- memmove_s
- wmemmove_s
- memset_s
- strcpy_s
- wcscpy_s
- strncpy_s
- wcsncpy_s
- strcat_s
- wcscat_s
- strncat_s
- wcsncat_s
- strtok_s
- wcstok_s
- sprintf_s
- swprintf_s
- vsprintf_s
- vswprintf_s
- snprintf_s
- vsnprintf_s
- scanf_s
- wscanf_s
- vscanf_s
- vwscanf_s
- fscanf_s
- fwscanf_s
- vfscanf_s
- vfwscanf_s
- sscanf_s
- swscanf_s
- vsscanf_s
- vswscanf_s
- gets_s
Build
- General
In the code root directory (where the Makefile is), run:
make
or
make shared
The generated shared library libboundscheck.so is stored in the newly
created directory lib. The shared is the default target of the Makefile.
If you replace the shared argument with static, a static library will be
automatically generated. Alternatively, replace it with all to generate
both shared and static libraries.
- Advanced
- Make and install
Use make install to install the libraries (and the headers). The
following commands will compile and install to ${HOME}/.local/ by default.
make
make install
To install to a custom location, specify DESTDIR with make install.
The following commands install headers and libraries to
${HOME}/my-project/third_party/libboundscheck:
make install DESTDIR=${HOME}/my-project/third_party/libboundscheck
- Specify the compiler via the
CCparameter
The following command uses gcc as the compiler:
make CC=gcc
- Specify the target's output filename
Use the LIBBOUNDSCHECK_SHARED or LIBBOUNDSCHECK_STATIC parameters
to specify the output target filename respectively:
The following command will output a shared library named libsecurec.so:
make LIBBOUNDSCHECK_SHARED=libsecurec.so
How to use
-
Copy the libboundscheck.so to the library file directory, for example: "/usr/local/lib/".
-
To use the libboundscheck, add the “-lboundscheck” parameters to the compiler, for example: “gcc -g -o test test.c -lboundscheck”.