Control: tags 925747 + patch
Control: tags 925747 + pending

Dear maintainer,

I've prepared an NMU for libkibi (versioned as 0.1.1-2.1) and
uploaded it to mentors for sponsoring. Please feel free to tell me if I
should remove it.

--
Regards
Sudip

diff -Nru libkibi-0.1.1/debian/changelog libkibi-0.1.1/debian/changelog
--- libkibi-0.1.1/debian/changelog      2016-12-25 15:27:55.000000000 +0000
+++ libkibi-0.1.1/debian/changelog      2020-03-31 19:34:31.000000000 +0100
@@ -1,3 +1,10 @@
+libkibi (0.1.1-2.1) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * Fix ftbfs with GCC. (Closes: #925747)
+
+ -- Sudip Mukherjee <sudipm.mukher...@gmail.com>  Tue, 31 Mar 2020 19:34:31 
+0100
+
 libkibi (0.1.1-2) unstable; urgency=medium
 
   * Move packaging to collab-maint git repository
diff -Nru libkibi-0.1.1/debian/patches/series 
libkibi-0.1.1/debian/patches/series
--- libkibi-0.1.1/debian/patches/series 1970-01-01 01:00:00.000000000 +0100
+++ libkibi-0.1.1/debian/patches/series 2020-03-31 19:34:31.000000000 +0100
@@ -0,0 +1 @@
+use_strdup.patch
diff -Nru libkibi-0.1.1/debian/patches/use_strdup.patch 
libkibi-0.1.1/debian/patches/use_strdup.patch
--- libkibi-0.1.1/debian/patches/use_strdup.patch       1970-01-01 
01:00:00.000000000 +0100
+++ libkibi-0.1.1/debian/patches/use_strdup.patch       2020-03-31 
19:34:00.000000000 +0100
@@ -0,0 +1,25 @@
+Description: Fix ftbfs with GCC
+ Use strdup() instead of using malloc() and then copying the full length
+ of the string.
+
+Author: Sudip Mukherjee <sudipm.mukher...@gmail.com>
+Bug-Debian: https://bugs.debian.org/925747
+
+---
+
+--- libkibi-0.1.1.orig/kibi/kibi.c
++++ libkibi-0.1.1/kibi/kibi.c
+@@ -313,12 +313,11 @@ static char *get_xdg_config_home(void) {
+     xdg_config_home = getenv("XDG_CONFIG_HOME");
+     if(xdg_config_home != NULL && strlen(xdg_config_home) > 0) {
+         length = strlen(xdg_config_home) + 1;
+-        result = malloc(length);
++        result = strdup(xdg_config_home);
+         if(unlikely(result == NULL)) {
+             malloc_error(length);
+             return NULL;
+         }
+-        strncpy(result, xdg_config_home, length);
+     } else { // xdg_config_home == NULL || strlen(xdg_config_home) == 0
+         // Use $HOME/.config if XDG_CONFIG_HOME is not defined.
+         home = getenv("HOME");

Reply via email to