Skip to content

Commit 71ac875

Browse files
committed
prepare for new release with Merge pull request #83 from RKX1209/fix_nullptr_ref
1 parent d5d1b89 commit 71ac875

File tree

6 files changed

+15
-6
lines changed

6 files changed

+15
-6
lines changed

ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
CHANGES
22

3+
4.0.2 Mon 01 Jul 2019 02:57:36 PM UTC
4+
5+
* Fix typo
6+
* Fix NULL-ptr dereference in shll string (Thanks to Ren Kimura<https://github.com/RKX1209>)
7+
38
4.0.1 Tue Nov 20 08:22:20 UTC 2018
49

510
* Add LDFLAGS environment variable (Thanks to zboszor <https://github.com/zboszor>)

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
AC_INIT([shc], [4.0.1], [http://github.com/neurobin/shc/issues])
1+
AC_INIT([shc], [4.0.2], [http://github.com/neurobin/shc/issues])
22
AC_CONFIG_AUX_DIR(config)
33
#prefix="/usr"
44
AC_CONFIG_SRCDIR([src/shc.c])

man.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ <h1 id="description">DESCRIPTION</h1>
4444
<p>If you supply an expiration date with the <code>-e</code> option, the compiled binary will refuse to run after the date specified. The message <strong>Please contact your provider</strong> will be displayed instead. This message can be changed with the <code>-m</code> option.</p>
4545
<p>You can compile any kind of shell script, but you need to supply valid <code>-i</code>, <code>-x</code> and <code>-l</code> options.</p>
4646
<p>The compiled binary will still be dependent on the shell specified in the first line of the shell code (i.e. <code>#!/bin/sh</code>), thus <strong>shc</strong> does not create completely independent binaries.</p>
47-
<p><strong>shc</strong> itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell <code>-c</code> option. Unfortunatelly, it will not give you any speed improvement as a real C program would.</p>
47+
<p><strong>shc</strong> itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability. It then uses the system compiler to compile a stripped binary which behaves exactly like the original script. Upon execution, the compiled binary will decrypt and execute the code with the shell <code>-c</code> option. Unfortunately, it will not give you any speed improvement as a real C program would.</p>
4848
<p><strong>shc</strong>'s main purpose is to protect your shell scripts from modification or inspection. You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.</p>
4949
<h1 id="options">OPTIONS</h1>
5050
<p>-e <em>date</em> : Expiration date in <em>dd/mm/yyyy</em> format <code>[none]</code></p>

man.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ thus **shc** does not create completely independent binaries.
2727
**shc** itself is not a compiler such as cc, it rather encodes and encrypts a shell script and generates C source code with the added expiration capability.
2828
It then uses the system compiler to compile a stripped binary which behaves exactly like the original script.
2929
Upon execution, the compiled binary will decrypt and execute the code with the shell `-c` option.
30-
Unfortunatelly, it will not give you any speed improvement as a real C program would.
30+
Unfortunately, it will not give you any speed improvement as a real C program would.
3131

3232
**shc**'s main purpose is to protect your shell scripts from modification or inspection.
3333
You can use it if you wish to distribute your scripts but don't want them to be easily readable by other people.

shc.1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ It then uses the system compiler to compile a stripped binary which
4040
behaves exactly like the original script.
4141
Upon execution, the compiled binary will decrypt and execute the code
4242
with the shell \f[C]\-c\f[] option.
43-
Unfortunatelly, it will not give you any speed improvement as a real C
43+
Unfortunately, it will not give you any speed improvement as a real C
4444
program would.
4545
.PP
4646
\f[B]shc\f[]\[aq]s main purpose is to protect your shell scripts from

src/shc.c

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
*/
1818

1919
static const char my_name[] = "shc";
20-
static const char version[] = "Version 4.0.1";
20+
static const char version[] = "Version 4.0.2";
2121
static const char subject[] = "Generic Shell Script Compiler";
2222
static const char cpright[] = "GNU GPL Version 3";
2323
static const struct { const char * f, * s, * e; }
@@ -265,7 +265,7 @@ static const char * RTC[] = {
265265
" BPF_STMT(BPF_LD+BPF_W+BPF_ABS, offsetof(struct seccomp_data, nr)),",
266266
"",
267267
" /* list of allowed syscalls */",
268-
" Allow(exit_group), /* exits a processs */",
268+
" Allow(exit_group), /* exits a process */",
269269
" Allow(brk), /* for malloc(), inside libc */",
270270
" Allow(mmap), /* also for malloc() */",
271271
" Allow(munmap), /* for free(), inside libc */",
@@ -971,6 +971,10 @@ int eval_shell(char * text)
971971

972972
shll = realloc(shll, strlen(shll) + 1);
973973
ptr = strrchr(shll, (int)'/');
974+
if (!ptr) {
975+
fprintf(stderr, "%s: invalid shll\n", my_name);
976+
return -1;
977+
}
974978
if (*ptr == '/')
975979
ptr++;
976980
if (verbose) fprintf(stderr, "%s shll=%s\n", my_name, ptr);

0 commit comments

Comments
 (0)