diff options
Diffstat (limited to 'utils/gssd/svcgssd_proc.c')
-rw-r--r-- | utils/gssd/svcgssd_proc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/utils/gssd/svcgssd_proc.c b/utils/gssd/svcgssd_proc.c index 14b7f17..b3a6ae8 100644 --- a/utils/gssd/svcgssd_proc.c +++ b/utils/gssd/svcgssd_proc.c @@ -200,7 +200,8 @@ get_ids(gss_name_t client_name, gss_OID mech, struct svc_cred *cred) maj_stat, min_stat, mech); goto out; } - if (!(sname = calloc(name.length + 1, 1))) { + if (name.length >= 0xffff || /* be certain name.length+1 doesn't overflow */ + !(sname = calloc(name.length + 1, 1))) { printerr(0, "WARNING: get_ids: error allocating %d bytes " "for sname\n", name.length + 1); gss_release_buffer(&min_stat, &name); |