[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-xorriso] Crash in xorriso with fix

From: Thomas Schmitt
Subject: Re: [Bug-xorriso] Crash in xorriso with fix
Date: Tue, 23 Jul 2019 18:56:15 +0200


thanks for reporting. Obviously i never tested ACLs larger than 64 KB.

--- a/xorriso/opts_p_z.c
+++ b/xorriso/opts_p_z.c
@@ -830,7 +830,7 @@ int Xorriso_option_session_log(struct XorrisO *xorriso, char
 *path, int flag)
 /* Option -setfacl_list alias -setfacl_listi */
 int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, char *path, int flag)
- int ret, eaten, line_size;
+ int ret, eaten, line_size, diff_buf_wpt;
  size_t buf_size= 0, buf_add= 64 * 1024, l, linecount= 0;
  char *line= NULL, *buf= NULL, *wpt, *new_buf, limit_text[80];
  char *file_path= NULL, *uid= NULL, *gid= NULL;
@@ -923,11 +923,13 @@ int Xorriso_option_setfacl_listi(struct XorrisO *xorriso, 
char *path, int flag)
        Xorriso_msgs_submit(xorriso, 0, xorriso->info_text, 0, "FAILURE", 0);
        ret= 0; goto ex;
+     diff_buf_wpt = wpt - buf;
      buf_size+= buf_add;
      new_buf= realloc(buf, buf_size);
      if(new_buf == NULL)
        goto out_of_mem;
      buf= new_buf;
+     wpt = buf + diff_buf_wpt;
    memcpy(wpt, line, l);
    *(wpt + l)= '\n';

Looks good to me. I will test and then commit to git.

The other issue might be the tip of the tail of a bigger problem.
Normally the text formatting functions should avoid to create texts larger
than xorriso->info_text. I will check whether Xorriso_normalize_acl_text()
is supposed to produce printable text and if so, how to handle the
For now it looks like it was indeed just wrong to print that text naively.

Have a nice day :)


reply via email to

[Prev in Thread] Current Thread [Next in Thread]