From 02ba921eec255752f9a130fa2b98983a6d00d37a Mon Sep 17 00:00:00 2001 From: Ezra Peisach Date: Mon, 25 Sep 2000 21:11:26 +0000 Subject: [PATCH] * ser_ktf.c (krb5_ktf_keytab_externalize): Do not violate const char * declaration of ktfile_def_name. * ktf_util.c (xfwrite): Cast length field to fwrite/fread as unsigned. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@12672 dc483132-0cff-0310-8789-dd5450dbe970 --- src/lib/krb5/keytab/file/ChangeLog | 7 +++++++ src/lib/krb5/keytab/file/ktf_util.c | 4 ++-- src/lib/krb5/keytab/file/ser_ktf.c | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/lib/krb5/keytab/file/ChangeLog b/src/lib/krb5/keytab/file/ChangeLog index 4f6bae1e7..2eeab44bb 100644 --- a/src/lib/krb5/keytab/file/ChangeLog +++ b/src/lib/krb5/keytab/file/ChangeLog @@ -1,3 +1,10 @@ +2000-09-25 Ezra Peisach + + * ser_ktf.c (krb5_ktf_keytab_externalize): Do not violate const char * + declaration of ktfile_def_name. + + * ktf_util.c (xfwrite): Cast length field to fwrite/fread as unsigned. + 1999-10-26 Wilfredo Sanchez * Makefile.in: Clean up usage of CFLAGS, CPPFLAGS, DEFS, DEFINES, diff --git a/src/lib/krb5/keytab/file/ktf_util.c b/src/lib/krb5/keytab/file/ktf_util.c index 4ae73fedb..d583581bc 100644 --- a/src/lib/krb5/keytab/file/ktf_util.c +++ b/src/lib/krb5/keytab/file/ktf_util.c @@ -86,8 +86,8 @@ typedef krb5_int16 krb5_kt_vno; krb5_kt_vno krb5_kt_default_vno = KRB5_KT_DEFAULT_VNO; -#define xfwrite(a, b, c, d) fwrite((char *)a, b, c, d) -#define xfread(a, b, c, d) fread((char *)a, b, c, d) +#define xfwrite(a, b, c, d) fwrite((char *)a, b, (unsigned) c, d) +#define xfread(a, b, c, d) fread((char *)a, b, (unsigned) c, d) #ifdef ANSI_STDIO static char *fopen_mode_rbplus= "rb+"; diff --git a/src/lib/krb5/keytab/file/ser_ktf.c b/src/lib/krb5/keytab/file/ser_ktf.c index 69f6d5d86..af4189617 100644 --- a/src/lib/krb5/keytab/file/ser_ktf.c +++ b/src/lib/krb5/keytab/file/ser_ktf.c @@ -124,7 +124,7 @@ krb5_ktf_keytab_externalize(kcontext, arg, buffer, lenremain) krb5_int32 file_pos[2]; char *ktname; size_t namelen; - char *fnamep; + const char *fnamep; required = 0; bp = *buffer; @@ -148,7 +148,7 @@ krb5_ktf_keytab_externalize(kcontext, arg, buffer, lenremain) if (ktdata && ktdata->name) fnamep = ktdata->name; else - fnamep = (char *) ktfile_def_name; + fnamep = ktfile_def_name; namelen += (strlen(fnamep)+1); if ((ktname = (char *) malloc(namelen))) { -- 2.26.2