cifscreds: check optind before accessing argv[optind]
Subsystems (2)
PATCH 1/1 cifscreds: check optind before accessing argv[optind]
Redhat bugzilla: 1278543
This fixes a segfault for some incorrect usage, for example
cifscreds -u test
--- cifscreds.c | 3 +++ 1 file changed, 3 insertions(+)
cifscreds.c +3 -0
@@ -487,6 +487,9 @@ int main(int argc, char **argv) } } +if (optind >= argc) +return usage (); +/* find the best fit command */ best =NULL ; n =strnlen (argv[optind],MAX_COMMAND_SIZE );
Signature · 1 line
2.15.1
A message that is not in the archive (sent off-list or not yet received): CAH2r5ms-rpxf5E_XZc1W+h1tMmV26WEbXWCxEfYa+cA7PX-VTw@mail.gmail.com
A message that is not in the archive (sent off-list or not yet received): CAH2r5ms-rpxf5E_XZc1W+h1tMmV26WEbXWCxEfYa+cA7PX-VTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org
----- Original Message -----
Quoted 7 lines
From: "Steve French" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "CIFS" <[email protected]>, "Pavel Shilovsky" <[email protected]>
Sent: Tuesday, 23 January, 2018 11:50:38 AM
Subject: Re: [PATCH] cifscreds: check optind before accessing argv[optind]I would like to add cc stable. Ok?
SGTM
Quoted 36 lines · Ronnie Sahlberg
Quoted 33 lines
Redhat bugzilla: 1278543
This fixes a segfault for some incorrect usage, for example
cifscreds -u testSigned-off-by Ronnie Sahlberg <[email protected]>--- cifscreds.c | 3 +++ 1 file changed, 3 insertions(+)cifscreds.c +3
-1@@ -487,6 +487,9 @@ int main(int argc, char **argv) } } +if (optind >= argc) +return usage (); +/* find the best fit command */ best =NULL ; n =strnlen (argv[optind],MAX_COMMAND_SIZE ); --2.15.1
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
A message that is not in the archive (sent off-list or not yet received): 1836982403.1740018.1516669060551.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org
sorry - I misread this. Userspace patch doersn't need the cc:
but in any case can add my reviewed-by
Quoted 51 lines · Ronnie Sahlberg
----- Original Message -----
Quoted 7 lines
From: "Steve French" <[email protected]>
To: "Ronnie Sahlberg" <[email protected]>
Cc: "CIFS" <[email protected]>, "Pavel Shilovsky" <[email protected]>
Sent: Tuesday, 23 January, 2018 11:50:38 AM
Subject: Re: [PATCH] cifscreds: check optind before accessing argv[optind]I would like to add cc stable. Ok?
SGTM
Quoted 36 lines · Ronnie Sahlberg
Quoted 33 lines
Redhat bugzilla: 1278543
This fixes a segfault for some incorrect usage, for example
cifscreds -u testSigned-off-by Ronnie Sahlberg <[email protected]>--- cifscreds.c | 3 +++ 1 file changed, 3 insertions(+)cifscreds.c +3
-1@@ -487,6 +487,9 @@ int main(int argc, char **argv) } } +if (optind >= argc) +return usage (); +/* find the best fit command */ best =NULL ; n =strnlen (argv[optind],MAX_COMMAND_SIZE ); --2.15.1
--
To unsubscribe from this list: send the line "unsubscribe linux-cifs" in the body of a message to [email protected] More majordomo info at http://vger.kernel.org/majordomo-info.html
Signature · 3 lines
Thanks, Steve