#1 Fix patch to correctly terminate strings
Merged 4 years ago by adamwill. Opened 4 years ago by tomh.
rpms/ tomh/bip fix-auth  into  master

@@ -18,23 +18,23 @@ 

  index 8163f32..98345aa 100644

  --- a/src/irc.c

  +++ b/src/irc.c

- @@ -631,8 +631,7 @@ static char *get_str_elem(char *str, int num)

+ @@ -634,7 +634,7 @@ static char *get_str_elem(char *str, int num)

   		if (c - cur < 1)

   			return NULL;

   		ret = bip_malloc(c - cur + 1);

  -		strncpy(ret, cur, c - cur);

- -		ret[c - cur] = 0;

- +		strncpy (ret, cur, c - cur + 1);

+ +		memcpy(ret, cur, c - cur);

+ 		ret[c - cur] = 0;

   		return ret;

   	}

   	if (index == num) {

- @@ -640,8 +639,7 @@ static char *get_str_elem(char *str, int num)

+ @@ -643,7 +643,7 @@ static char *get_str_elem(char *str, int num)

   		if (c - cur < 1)

   			return NULL;

   		ret = bip_malloc(c - cur + 1);

  -		strncpy(ret, cur, c - cur);

- -		ret[c - cur] = 0;

- +		strncpy (ret, cur, c - cur + 1);

+ +		memcpy(ret, cur, c - cur);

+ 		ret[c - cur] = 0;

   		return ret;

   	}

   	return NULL;

file modified
+4 -1
@@ -5,7 +5,7 @@ 

  

  Name:    bip

  Version: 0.9.0

- Release: 0.6.%{date}git%{shortcommit}%{?dist}

+ Release: 0.7.%{date}git%{shortcommit}%{?dist}

  Summary: IRC Bouncer

  License: GPLv2+

  URL: http://bip.t1r.net
@@ -119,6 +119,9 @@ 

  %{_unitdir}/bip.service

  

  %changelog

+ * Thu Apr 23 2020 Tom Hughes <tom@compton.nu> - 0.9.0-0.7.20181225gitc9cc64f

+ - Fix patch to correctly terminate strings

+ 

  * Fri Feb 07 2020 Adam Williamson <awilliam@redhat.com> - 0.9.0-0.6.20181225gitc9cc64f

  - Fix a build failure on Rawhide (thanks DJ Delorie)

  

This fixes bip in F32 and rawhide so that you can actually authenticate to it again ;-)

Pull-Request has been merged by adamwill

4 years ago