SecBSD's official ports repository
This commit is contained in:
commit
2c0afcbbf3
64331 changed files with 5339189 additions and 0 deletions
25
devel/premake4/patches/patch-src_host_os_getversion_c
Normal file
25
devel/premake4/patches/patch-src_host_os_getversion_c
Normal file
|
@ -0,0 +1,25 @@
|
|||
Don't use a pointer to stack storage.
|
||||
|
||||
--- src/host/os_getversion.c.orig Tue Nov 26 16:38:58 2013
|
||||
+++ src/host/os_getversion.c Sun Dec 4 14:03:03 2016
|
||||
@@ -202,16 +202,13 @@ void getversion(struct OsVersionInfo* info)
|
||||
return;
|
||||
}
|
||||
|
||||
-#if __GLIBC__
|
||||
- // When using glibc, info->description gets set to u.sysname,
|
||||
- // but it isn't passed out of this function, so we need to copy
|
||||
- // the string.
|
||||
info->description = malloc(strlen(u.sysname) + 1);
|
||||
+ if (info->description == NULL) {
|
||||
+ info->description = PLATFORM_STRING;
|
||||
+ return;
|
||||
+ }
|
||||
strcpy((char*)info->description, u.sysname);
|
||||
info->isalloc = 1;
|
||||
-#else
|
||||
- info->description = u.sysname;
|
||||
-#endif
|
||||
|
||||
if ((ver = strtok(u.release, ".-")) != NULL)
|
||||
{
|
Loading…
Add table
Add a link
Reference in a new issue