[15929] in Kerberos-V5-bugs

home help back first fref pref prev next nref lref last post

[krbdev.mit.edu #8661] ksu segfaults when argc == 0

daemon@ATHENA.MIT.EDU (Erik Sjölund via RT)
Sun Apr 1 13:11:36 2018

Mail-followup-to: rt@krbdev.mit.edu
mail-copies-to: never
From: "Erik Sjölund via RT" <rt-comment@KRBDEV-PROD-APP-1.mit.edu>
In-Reply-To: <rt-8661@krbdev.mit.edu>
Message-ID: <rt-8661-48362.13.3113482740189@krbdev.mit.edu>
To: "'AdminCc of krbdev.mit.edu Ticket #8661'":;
Date: Sun,  1 Apr 2018 13:11:21 -0400 (EDT)
Reply-To: rt-comment@KRBDEV-PROD-APP-1.mit.edu
Content-Type: multipart/mixed; boundary="===============9210908839500379912=="
Errors-To: krb5-bugs-bounces@mit.edu

--===============9210908839500379912==

Programs are generally started with argc >= 1,
but it is possible to start a program with an
empty argv (i.e. argc == 0).

Current behaviour:
ksu segfaults when started with argc == 0.

Expected behaviour:
I would expect ksu to just exit with an error
instead.

Here is a demonstration of the segmentation fault:

user@laptop:/tmp$ cat /etc/issue
Ubuntu 17.10 \n \l

user@laptop:/tmp$ cat main.cc
#include <unistd.h>
int main() {
  char* arr[] = {nullptr};
  execv("/usr/bin/ksu", arr);
}
user@laptop:/tmp$ g++ -std=c++11 -o /tmp/start main.cc
user@laptop:/tmp$ /tmp/start
Segmentation fault (core dumped)
user@laptop:/tmp$

Best regards,
Erik Sjölund



--===============9210908839500379912==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
krb5-bugs mailing list
krb5-bugs@mit.edu
https://mailman.mit.edu/mailman/listinfo/krb5-bugs

--===============9210908839500379912==--

home help back first fref pref prev next nref lref last post