summaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorKen Raeburn <raeburn@mit.edu>2008-03-29 01:10:30 +0000
committerKen Raeburn <raeburn@mit.edu>2008-03-29 01:10:30 +0000
commit965be2b05dae5e08a39781696d221182ec3acb34 (patch)
tree44be0709cfd9d3c69d5bd2cc18dc6b99fc3219fa /src/lib
parentede433da9ba2514bcbaa49cf413f1ecb3fd23fcb (diff)
downloadkrb5-965be2b05dae5e08a39781696d221182ec3acb34.tar.gz
krb5-965be2b05dae5e08a39781696d221182ec3acb34.tar.xz
krb5-965be2b05dae5e08a39781696d221182ec3acb34.zip
Coverity CID 220: NULL check of "buf" after dereference
All call sites have previously dereferenced the pointer, but to keep the interface simple, keep the null check, and move the dereference to after it. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20300 dc483132-0cff-0310-8789-dd5450dbe970
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/gssapi/mechglue/g_glue.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/gssapi/mechglue/g_glue.c b/src/lib/gssapi/mechglue/g_glue.c
index 41759468f..f5bed4719 100644
--- a/src/lib/gssapi/mechglue/g_glue.c
+++ b/src/lib/gssapi/mechglue/g_glue.c
@@ -124,7 +124,7 @@ gssint_der_length_size(unsigned int len)
int
gssint_put_der_length(unsigned int length, unsigned char **buf, unsigned int max_len)
{
- unsigned char *s = *buf, *p;
+ unsigned char *s, *p;
unsigned int buf_len = 0;
int i, first;
@@ -132,6 +132,8 @@ gssint_put_der_length(unsigned int length, unsigned char **buf, unsigned int max
if (buf == 0 || max_len < 1)
return (-1);
+ s = *buf;
+
/* Single byte is the length */
if (length < 128) {
*s++ = length;