Check return value from asprintf instead of string != NULL since it
undefined behavior on Linux. From Björn Sandell git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16215 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -1023,9 +1023,10 @@ retrieve(const char *cmd, char *name)
|
||||
*tail = c;
|
||||
if (p->rev_cmd != NULL) {
|
||||
char *ext;
|
||||
int ret;
|
||||
|
||||
asprintf(&ext, "%s%s", name, p->ext);
|
||||
if (ext != NULL) {
|
||||
ret = asprintf(&ext, "%s%s", name, p->ext);
|
||||
if (ret != -1) {
|
||||
if (access(ext, R_OK) == 0) {
|
||||
snprintf (line, sizeof(line),
|
||||
p->rev_cmd, ext);
|
||||
|
@@ -105,8 +105,7 @@ gss_userok(void *app_data, char *username)
|
||||
|
||||
chown (ticketfile, kpw->pw_uid, kpw->pw_gid);
|
||||
|
||||
asprintf(&k5ccname, "FILE:%s", ticketfile);
|
||||
if (k5ccname) {
|
||||
if (asprintf(&k5ccname, "FILE:%s", ticketfile) != -1) {
|
||||
esetenv ("KRB5CCNAME", k5ccname, 1);
|
||||
}
|
||||
afslog(NULL, 1);
|
||||
|
Reference in New Issue
Block a user