The variables are only being read as strings (char *), so data after the
'\0' can't be leaked.
Cc: Christian Göttsche <cgzones@googlemail.com>
Cc: Serge Hallyn <serge@hallyn.com>
Cc: Iker Pedrosa <ipedrosa@redhat.com>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
/*@-exitarg@*/
#include "exitcodes.h"
#include "shadowlog.h"
+#include "strlcpy.h"
#ifndef SHELLS_FILE
#define SHELLS_FILE "/etc/shells"
break;
case 's':
sflg = true;
- STRFCPY (loginsh, optarg);
+ STRLCPY(loginsh, optarg);
break;
default:
usage (E_USAGE);
* file, or use the value from the command line.
*/
if (!sflg) {
- STRFCPY (loginsh, pw->pw_shell);
+ STRLCPY(loginsh, pw->pw_shell);
}
/*