Bug#619503: fix use-after-free in x11.vapi

2011-04-06 Thread Alexander Kurtz
forwarded 619503 
http://mail.gnome.org/archives/vala-list/2011-April/msg00028.html
tags 619503 fixed-upstream
thanks

This has been fixed upstream:

http://git.gnome.org/browse/vala/commit/?id=5d8b408e560cac7e9b94230c983722d2d88cd169

Best regards

Alexander Kurtz


signature.asc
Description: This is a digitally signed message part


Bug#619503: fix use-after-free in x11.vapi

2011-03-24 Thread Alexander Kurtz
Package: valac-0.10
Version: 0.10.4-1
Severity: normal
Tags: patch

Hi,

This works with Vala 0.10.4:

$ cat test.vala 
void main(){
X.Display disp = new X.Display();
stdout.printf(%s\n, disp.display_string());
}
$ valac --pkg=x11 test.vala  ./test 
:0.0 
$

This doesn't work with Vala 0.10.4:

$ cat test.vala 
void main(){
X.Display disp = new X.Display();
stdout.printf(%s\n, disp.display_string());
stdout.printf(%s\n, disp.display_string());
}
$ valac --pkg=x11 test.vala  ./test 
:0.0

*** glibc detected *** ./test: double free or corruption (fasttop): 0x08509958 
***
[...]

This patch fixes the issues for me:

--- x11.vapi.orig   2011-03-14 14:07:46.731734844 +0100
+++ x11.vapi2011-03-14 14:08:04.103728858 +0100
@@ -76,7 +76,7 @@
public unowned Screen screen_by_id (int screen_number);
 
[CCode (cname = DisplayString)]
-   public string display_string ();
+   public unowned string display_string ();
 
[CCode (cname = XQLength)]
public int event_queue_length ();

Best regards

Alexander Kurtz


signature.asc
Description: This is a digitally signed message part