From nobody@FreeBSD.org  Mon Mar 11 14:02:33 2013
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1])
	by hub.freebsd.org (Postfix) with ESMTP id B2061F4D
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Mar 2013 14:02:33 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id A2D973CC
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Mar 2013 14:02:33 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.5/8.14.5) with ESMTP id r2BE2Wob013835
	for <freebsd-gnats-submit@FreeBSD.org>; Mon, 11 Mar 2013 14:02:32 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.5/8.14.5/Submit) id r2BE2WIp013834;
	Mon, 11 Mar 2013 14:02:32 GMT
	(envelope-from nobody)
Message-Id: <201303111402.r2BE2WIp013834@red.freebsd.org>
Date: Mon, 11 Mar 2013 14:02:32 GMT
From: Ivan Klymenko <fidaj@ukr.net>
To: freebsd-gnats-submit@FreeBSD.org
Subject: [patch] net-im/pidgin segmentation fault with cap plugin
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         176851
>Category:       ports
>Synopsis:       [patch] net-im/pidgin segmentation fault with cap plugin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    marcus
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Mar 11 14:10:00 UTC 2013
>Closed-Date:    Sun Mar 24 20:39:57 UTC 2013
>Last-Modified:  Sun Mar 24 20:40:00 UTC 2013
>Originator:     Ivan Klymenko
>Release:        FreeBSD 10.0-CURRENT
>Organization:
individual
>Environment:
FreeBSD nonamehost 10.0-CURRENT FreeBSD 10.0-CURRENT #0: Sat Mar  9 23:29:58 EET 2013     root@nonamehost:/usr/obj/usr/src/sys/GENERIC  amd64
>Description:
when compiling the port encounter the following warnings:
..
cap.c: In function 'generate_prediction_for':
cap.c:46: warning: initialization makes integer from pointer without a cast
cap.c:97: warning: assignment makes integer from pointer without a cast
cap.c:99: warning: passing argument 1 of 'strcmp' makes pointer from integer without a cast
..

and occurs segmentation fault:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 80a806400 (LWP 101046/pidgin)]
0x000000080cb03ef1 in get_stats_for (buddy=<value optimized out>) at cap.c:99
99		if(sta_id && !strcmp(sta_id, "offline")) {

>How-To-Repeat:
run pidgin
>Fix:
fixing in patch

Patch attached with submission follows:

--- pOidgin/plugins/cap/cap.c.orig	2013-03-11 15:40:09.000000000 +0200
+++ pOidgin/plugins/cap/cap.c	2013-03-11 15:40:17.000000000 +0200
@@ -43,7 +43,7 @@
 	int threshold = purple_prefs_get_int("/plugins/gtk/cap/threshold");
 	int min_minute = (current_minute - threshold) % 1440;
 	int max_minute = (current_minute + threshold) % 1440;
-	char *sql, sta_id = NULL;
+	char *sql, *sta_id = NULL;
 	sqlite3_stmt *stmt = NULL;
 	const char *tail = NULL;
 	int rc;


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->marcus 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Mon Mar 11 14:10:08 UTC 2013 
Responsible-Changed-Why:  
Over to maintainer (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176851 

From: Ivan Klymenko <fidaj@ukr.net>
To: bug-followup@FreeBSD.org, fidaj@ukr.net
Cc:  
Subject: Re: ports/176851: [patch] net-im/pidgin segmentation fault with cap
 plugin
Date: Mon, 11 Mar 2013 16:22:45 +0200

 so sorry, mechanically typo
 
 s/pOidgin/pidgin/g
State-Changed-From-To: open->closed 
State-Changed-By: marcus 
State-Changed-When: Sun Mar 24 20:39:40 UTC 2013 
State-Changed-Why:  
Committed, thanks!  Please make sure to push this patch upstream. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=176851 

From: dfilter@FreeBSD.ORG (dfilter service)
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: ports/176851: commit references a PR
Date: Sun, 24 Mar 2013 20:39:34 +0000 (UTC)

 Author: marcus
 Date: Sun Mar 24 20:39:21 2013
 New Revision: 315159
 URL: http://svnweb.freebsd.org/changeset/ports/315159
 
 Log:
   Fix a crash with the cap plugin.
   
   PR:             176851
   Submitted by:   Ivan Klymenko <fidaj@ukr.net>
 
 Added:
   head/net-im/libpurple/files/patch-pidgin_plugins_cap_cap.c   (contents, props changed)
 Modified:
   head/net-im/pidgin/Makefile
 
 Added: head/net-im/libpurple/files/patch-pidgin_plugins_cap_cap.c
 ==============================================================================
 --- /dev/null	00:00:00 1970	(empty, because file is newly added)
 +++ head/net-im/libpurple/files/patch-pidgin_plugins_cap_cap.c	Sun Mar 24 20:39:21 2013	(r315159)
 @@ -0,0 +1,11 @@
 +--- pidgin/plugins/cap/cap.c.orig	2013-03-24 20:34:29.882262000 +0000
 ++++ pidgin/plugins/cap/cap.c	2013-03-24 20:34:39.576121000 +0000
 +@@ -43,7 +43,7 @@ static double generate_prediction_for(Pu
 + 	int threshold = purple_prefs_get_int("/plugins/gtk/cap/threshold");
 + 	int min_minute = (current_minute - threshold) % 1440;
 + 	int max_minute = (current_minute + threshold) % 1440;
 +-	char *sql, sta_id = NULL;
 ++	char *sql, *sta_id = NULL;
 + 	sqlite3_stmt *stmt = NULL;
 + 	const char *tail = NULL;
 + 	int rc;
 
 Modified: head/net-im/pidgin/Makefile
 ==============================================================================
 --- head/net-im/pidgin/Makefile	Sun Mar 24 20:26:48 2013	(r315158)
 +++ head/net-im/pidgin/Makefile	Sun Mar 24 20:39:21 2013	(r315159)
 @@ -7,7 +7,7 @@
  #
  
  PORTNAME=	pidgin
 -PORTREVISION=	0
 +PORTREVISION=	1
  
  MAINTAINER=	marcus@FreeBSD.org
  COMMENT=	Pidgin multi-protocol messaging client (GTK+ UI)
 _______________________________________________
 svn-ports-all@freebsd.org mailing list
 http://lists.freebsd.org/mailman/listinfo/svn-ports-all
 To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
 
>Unformatted:
