Check for out of memory.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@1009 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Assar Westerlund
1996-11-17 04:41:53 +00:00
parent 513527169b
commit 467c862f2b

View File

@@ -135,6 +135,10 @@ set (int argc, char **argv, int count, OtpAlgorithm *alg)
ctx.alg = alg;
ctx.user = strdup (pwd->pw_name);
if (ctx.user == NULL) {
fprintf (stderr, "%s: Out of memory\n", prog);
return 1;
}
ctx.n = atoi (argv[0]);
strncpy (ctx.seed, argv[1], sizeof(ctx.seed));
ctx.seed[sizeof(ctx.seed) - 1] = '\0';