projects
/
oweals
/
busybox.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a2bdc5c
)
add-remove-shell: fix crash when shell is already added
author
Timo Teräs
<timo.teras@iki.fi>
Fri, 14 Jul 2017 07:59:52 +0000
(09:59 +0200)
committer
Denys Vlasenko
<vda.linux@googlemail.com>
Fri, 14 Jul 2017 07:59:52 +0000
(09:59 +0200)
Avoid dereferencing 'don_add' in strcmp since it is invalid
pointer.
Signed-off-by: Timo Teräs <timo.teras@iki.fi>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
loginutils/add-remove-shell.c
patch
|
blob
|
history
diff --git
a/loginutils/add-remove-shell.c
b/loginutils/add-remove-shell.c
index 922b3333d43d7a06c841ec6aa00c015727068f22..54b62c7731b9b964eebeae88e6c303311acf2ba4 100644
(file)
--- a/
loginutils/add-remove-shell.c
+++ b/
loginutils/add-remove-shell.c
@@
-84,7
+84,7
@@
int add_remove_shell_main(int argc UNUSED_PARAM, char **argv)
while ((line = xmalloc_fgetline(orig_fp)) != NULL) {
char **cpp = argv;
while (*cpp) {
- if (strcmp(*cpp, line) == 0) {
+ if (
*cpp != dont_add &&
strcmp(*cpp, line) == 0) {
/* Old file has this shell name */
if (REMOVE_SHELL) {
/* we are remove-shell */