Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

patch for possible SEH/Stack Buffer overflow (CVE-2023-33693) #24

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Src/C++/EasyPlayerPro/xmlConfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ int XMLConfig::LoadConfig(char *filename, PRO_CONFIG_T *pConfig)
proConfig.channel[i].autoPlay = 0;
}

SaveConfig(filename, &proConfig); //�����������ļ�, ����һ���µ������ļ�
SaveConfig(filename, &proConfig); //不存在配置文件, 生成一个新的配置文件
if (NULL != pConfig) memcpy(pConfig, &proConfig, sizeof(PRO_CONFIG_T));
return ret;
}
Expand Down Expand Up @@ -92,7 +92,7 @@ int XMLConfig::LoadConfig(char *filename, PRO_CONFIG_T *pConfig)
TiXmlAttribute *pAttr = pCh->FirstAttribute();
while (NULL != pAttr)
{
if (0 == strcmp(pAttr->Name(), "URL")) strcpy(proConfig.channel[chIdx].url, pAttr->Value());
if (0 == strcmp(pAttr->Name(), "URL")) strncpy(proConfig.channel[chIdx].url, pAttr->Value(), URL_LENGTH);
else if (0 == strcmp(pAttr->Name(), "OSD")) proConfig.channel[chIdx].showOSD = atoi(pAttr->Value());
else if (0 == strcmp(pAttr->Name(), "Protocol")) proConfig.channel[chIdx].protocol = atoi(pAttr->Value());
else if (0 == strcmp(pAttr->Name(), "Cache")) proConfig.channel[chIdx].cache = atoi(pAttr->Value());
Expand Down Expand Up @@ -186,7 +186,7 @@ void XMLConfig::SaveConfig(char *filename, PRO_CONFIG_T *pConfig)
pCh->SetAttribute("ShowToolbar", proConfig.channel[i].showToolbar);
pCh->SetAttribute("AutoPlay", proConfig.channel[i].autoPlay);
}
pRootElm->LinkEndChild(pChannel); //���ӵ��ڵ�RootLv1��
pRootElm->LinkEndChild(pChannel); //链接到节点RootLv1下

xmlDoc.InsertEndChild(*pRootElm) ;

Expand Down
6 changes: 4 additions & 2 deletions Src/C++/EasyPlayerPro/xmlConfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,12 @@

#define XML_CONFIG_FILENAME "EasyPlayerPro.xml"

#define URL_LENGTH 256


typedef struct __CHANNEL_INFO_T
{
char url[256];
char url[URL_LENGTH];
int showOSD;
int protocol; //1:tcp other:udp
int cache;
Expand All @@ -22,7 +24,7 @@ typedef struct __PRO_CONFIG_T
int fullScreen;
int recordingFileSize;
int recordingDuration;
int recordingFileAutoSegmentation; //¼���ļ��Զ��ָ�
int recordingFileAutoSegmentation; //¼ÏñÎļþ×Ô¶¯·Ö¸î

CHANNEL_INFO_T channel[16];
}PRO_CONFIG_T;
Expand Down