mirror of
https://github.com/tuxbox-fork-migrations/recycled-ni-neutrino.git
synced 2025-08-28 16:01:10 +02:00
plugins.cpp localize.cpp: fix possible segfault
Origin commit data
------------------
Branch: ni/coolstream
Commit: 1fdb76af51
Author: Jacek Jendrzej <overx300@gmail.com>
Date: 2012-04-24 (Tue, 24 Apr 2012)
------------------
No further description and justification available within origin commit message!
------------------
This commit was generated by Migit
This commit is contained in:
@@ -42,6 +42,7 @@
|
|||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
|
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
#include <stdio.h>
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <sys/ioctl.h>
|
#include <sys/ioctl.h>
|
||||||
|
|
||||||
@@ -325,12 +326,16 @@ void CPlugins::startScriptPlugin(int number)
|
|||||||
FILE *f = popen(script,"r");
|
FILE *f = popen(script,"r");
|
||||||
if (f != NULL)
|
if (f != NULL)
|
||||||
{
|
{
|
||||||
char output[1024];
|
char *output=NULL;
|
||||||
while (fgets(output,1024,f))
|
size_t len = 0;
|
||||||
|
while (( getline(&output, &len, f)) != -1)
|
||||||
|
|
||||||
{
|
{
|
||||||
scriptOutput += output;
|
scriptOutput += output;
|
||||||
}
|
}
|
||||||
pclose(f);
|
pclose(f);
|
||||||
|
if(output)
|
||||||
|
free(output);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@@ -149,13 +149,14 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
char buf[1000];
|
char *buf=NULL;
|
||||||
|
size_t len = 0;
|
||||||
|
|
||||||
i = 1;
|
i = 1;
|
||||||
|
|
||||||
while(!feof(fd))
|
while(!feof(fd))
|
||||||
{
|
{
|
||||||
if(fgets(buf,sizeof(buf),fd)!=NULL)
|
if(getline(&buf, &len, fd)!=-1)
|
||||||
{
|
{
|
||||||
char * val = NULL;
|
char * val = NULL;
|
||||||
char * tmpptr = buf;
|
char * tmpptr = buf;
|
||||||
@@ -203,6 +204,9 @@ CLocaleManager::loadLocale_ret_t CLocaleManager::loadLocale(const char * const l
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
fclose(fd);
|
fclose(fd);
|
||||||
|
if(buf)
|
||||||
|
free(buf);
|
||||||
|
|
||||||
for (unsigned j = 1; j < (sizeof(locale_real_names)/sizeof(const char *)); j++)
|
for (unsigned j = 1; j < (sizeof(locale_real_names)/sizeof(const char *)); j++)
|
||||||
if (loadData[j] == locale_real_names[j])
|
if (loadData[j] == locale_real_names[j])
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user