From: John Carr Date: Sun, 23 Feb 1992 12:04:11 +0000 (+0000) Subject: Improve error checking X-Git-Tag: krb5-1.0-beta2~253 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=640497bb6d07a316400e7583dce58b8b91187d7c;p=krb5.git Improve error checking git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@2209 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/admin/edit/dump.c b/src/admin/edit/dump.c index 25b001cd0..0727d27c4 100644 --- a/src/admin/edit/dump.c +++ b/src/admin/edit/dump.c @@ -244,10 +244,18 @@ void load_db(argc, argv) goto error_out; } for (;;) { + int nitems; + lineno++; memset((char *)&entry, 0, sizeof(entry)); - if (fscanf(f,"%d\t%d\t", &name_len, &mod_name_len) == EOF) + nitems = fscanf(f,"%d\t%d\t", &name_len, &mod_name_len); + if (nitems == EOF) break; + if (nitems != 2) { + fprintf(stderr, "Couldn't parse line #%d\n", lineno); + load_error++; + break; + } if (!(name = malloc(name_len+1))) { com_err(argv[0], errno, "While allocating space for name");