diff options
| author | Ken Raeburn <raeburn@mit.edu> | 2007-07-12 23:33:25 +0000 |
|---|---|---|
| committer | Ken Raeburn <raeburn@mit.edu> | 2007-07-12 23:33:25 +0000 |
| commit | 52571d9201c7bef4dc5ebdf14a41db1f7baddc8e (patch) | |
| tree | 9f108e05e8881ea19954b4959fdca96d47daa615 /src/util/support/errors.c | |
| parent | 57913ccc175061dd41e98914d50eda56dd9685c0 (diff) | |
| download | krb5-52571d9201c7bef4dc5ebdf14a41db1f7baddc8e.tar.gz krb5-52571d9201c7bef4dc5ebdf14a41db1f7baddc8e.tar.xz krb5-52571d9201c7bef4dc5ebdf14a41db1f7baddc8e.zip | |
Avoid use of unchecked sprintf in libraries. Use asprintf if the
output buffer is allocated according to the size of data to be
written, or snprintf otherwise.
git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@19703 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/util/support/errors.c')
| -rw-r--r-- | src/util/support/errors.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/support/errors.c b/src/util/support/errors.c index e2101a2a9..94290f857 100644 --- a/src/util/support/errors.c +++ b/src/util/support/errors.c @@ -125,7 +125,8 @@ krb5int_get_error (struct errinfo *ep, long code) return r2; } format_number: - sprintf (ep->scratch_buf, _("error %ld"), code); + snprintf (ep->scratch_buf, sizeof(ep->scratch_buf), + _("error %ld"), code); return ep->scratch_buf; } r = (char *) fptr(code); |
