File: alloc_buffer.patch

package info (click to toggle)
libxdg-basedir 1.2.0-2.4
  • links: PTS
  • area: main
  • in suites: forky, sid
  • size: 1,740 kB
  • sloc: sh: 11,285; ansic: 695; makefile: 66
file content (13 lines) | stat: -rw-r--r-- 646 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
Index: libxdg-basedir-1.2.0/src/basedir.c
===================================================================
--- libxdg-basedir-1.2.0.orig/src/basedir.c	2014-02-11 19:56:41.702376488 +0100
+++ libxdg-basedir-1.2.0/src/basedir.c	2014-02-11 19:56:41.698376482 +0100
@@ -574,7 +574,7 @@
 		unsigned int homelen;
 		if (!(home = xdgGetEnv("HOME")))
 			return NULL;
-		if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength))) return NULL;
+		if (!(relhome = (char*)malloc((homelen = strlen(home))+fallbacklength+1))) return NULL;
 		memcpy(relhome, home, homelen);
 		memcpy(relhome+homelen, relativefallback, fallbacklength+1);
 	}