lib/krb5: krb5_config_parse_file_multi use after free
If the file is not a regular file, the 'fname' buffer will be freed before it is passed to the krb5_set_error_message() routine. That this is true is not obvious from code inspection but 'newfname' and 'fname' refer to the same memory. Change-Id: I7780eae9ceaf01b245df488a2f7d7f406770864f
This commit is contained in:

committed by
Viktor Dukhovni

parent
d8a112ae1a
commit
23ee804e9d
@@ -658,9 +658,9 @@ krb5_config_parse_file_multi (krb5_context context,
|
|||||||
if (!S_ISREG(st.st_mode)) {
|
if (!S_ISREG(st.st_mode)) {
|
||||||
(void) fclose(f.f);
|
(void) fclose(f.f);
|
||||||
context->config_include_depth--;
|
context->config_include_depth--;
|
||||||
free(newfname);
|
|
||||||
krb5_set_error_message(context, EISDIR, "not a regular file %s: %s",
|
krb5_set_error_message(context, EISDIR, "not a regular file %s: %s",
|
||||||
fname, strerror(EISDIR));
|
fname, strerror(EISDIR));
|
||||||
|
free(newfname);
|
||||||
return EISDIR;
|
return EISDIR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user