Hi Jakub,

On Mon, 5 Jan 2015 12:17:02 +0100, Jakub Wilk <[email protected]> wrote:
> * Stephen Kitt <[email protected]>, 2015-01-05, 07:26:
> >I'm going to submit the following patch which handles all your 
> >traversal cases (albeit in a somewhat ugly manner for relative 
> >traversals):
> 
> As a data point, cabextract(1) replaces ".." components with "xx" on 
> unpack, which is a different kind of ugly. :-)

Indeed... My patch was accepted upstream so I'll stick with that!

> >+            char *rawpath = g_file_get_path(gfile);
> >+            if (rawpath != NULL) {
> 
> Hmm. I'm not familiar with GLib, so I wonder in what circumstances 
> g_file_get_path() can return NULL. What happens in that case?

GIO supports non-local filenames (for network files, e.g. via ssh), and when
manipulating those g_file_get_path() returns NULL. The rest of gcab doesn't
deal with this AFAICT so I added the test simply to avoid any risk of
introducing a null pointer dereference!

> >Can you spot any issues there?
> 
> Apart from the doubts raised above, the patch looks good to me.

Thanks!

Stephen

Attachment: pgp5EeGhI1h7m.pgp
Description: OpenPGP digital signature

Reply via email to