Mageia Bugzilla – Attachment 8810 Details for
Bug 19932
libgsf new security issue CVE-2016-9888
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
New Account
|
Forgot Password
test program
gsf-sample.vala (text/x-vala), 1.01 KB, created by
Herman Viaene
on 2016-12-22 16:15:18 CET
(
hide
)
Description:
test program
Filename:
MIME Type:
Creator:
Herman Viaene
Created:
2016-12-22 16:15:18 CET
Size:
1.01 KB
patch
obsolete
> int main () { > > // declare objects > Gsf.InputStdio file; > Gsf.InfileZip zipfile; > Gsf.OutfileStdio folder; > > // load the ZIP file > try { file = new Gsf.InputStdio ("myarchive.zip"); } > catch { stderr.printf ("File \"myarchive.zip\" not found"); > return 1; } > // > try { zipfile = new Gsf.InfileZip (file); } > catch { stderr.printf ("Not a ZIP file"); > return 1; } > > // create the destination directory > try { folder = new Gsf.OutfileStdio ("myarchive"); } > catch { stderr.printf ("Cannot write to current directory"); > return 1; } > > // get the number of root items in the archive > // and iterate through them, writing each one > // to the destination directory > int num_items = zipfile.num_children (); > for (int i = 0; i < num_items; i++) > { > var item = zipfile.child_by_index (i); > var itemfile = Gsf.StructuredBlob.read (item); > > itemfile.write (folder); > } > > return 0; >}
int main () { // declare objects Gsf.InputStdio file; Gsf.InfileZip zipfile; Gsf.OutfileStdio folder; // load the ZIP file try { file = new Gsf.InputStdio ("myarchive.zip"); } catch { stderr.printf ("File \"myarchive.zip\" not found"); return 1; } // try { zipfile = new Gsf.InfileZip (file); } catch { stderr.printf ("Not a ZIP file"); return 1; } // create the destination directory try { folder = new Gsf.OutfileStdio ("myarchive"); } catch { stderr.printf ("Cannot write to current directory"); return 1; } // get the number of root items in the archive // and iterate through them, writing each one // to the destination directory int num_items = zipfile.num_children (); for (int i = 0; i < num_items; i++) { var item = zipfile.child_by_index (i); var itemfile = Gsf.StructuredBlob.read (item); itemfile.write (folder); } return 0; }
View Attachment As Raw
Actions:
View
Attachments on
bug 19932
: 8810