mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-08 19:08:14 +00:00
don't call poll() with an unitialized structure (bug #4387)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -467,7 +467,7 @@ static int ast_makesocket(void)
|
|||||||
|
|
||||||
if (perms!=NULL) {
|
if (perms!=NULL) {
|
||||||
mode_t p;
|
mode_t p;
|
||||||
sscanf(perms,"%o",&p);
|
sscanf(perms, "%o", (int *) &p);
|
||||||
if ((chmod(ast_config_AST_SOCKET,p))<0)
|
if ((chmod(ast_config_AST_SOCKET,p))<0)
|
||||||
ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET,strerror(errno));
|
ast_log(LOG_WARNING, "Unable to change file permissions of %s: %s\n", ast_config_AST_SOCKET,strerror(errno));
|
||||||
}
|
}
|
||||||
@@ -1690,7 +1690,6 @@ int main(int argc, char *argv[])
|
|||||||
int num;
|
int num;
|
||||||
char *buf;
|
char *buf;
|
||||||
char *runuser=NULL, *rungroup=NULL;
|
char *runuser=NULL, *rungroup=NULL;
|
||||||
struct pollfd silly_macos[1];
|
|
||||||
|
|
||||||
/* Remember original args for restart */
|
/* Remember original args for restart */
|
||||||
if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
|
if (argc > sizeof(_argv) / sizeof(_argv[0]) - 1) {
|
||||||
@@ -2060,7 +2059,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
}
|
}
|
||||||
/* Do nothing */
|
/* Do nothing */
|
||||||
for(;;)
|
for(;;) { /* apparently needed for the MACos */
|
||||||
poll(silly_macos,0, -1);
|
struct pollfd p = { -1 /* no descriptor */, 0, 0 };
|
||||||
|
poll(&p, 0, -1);
|
||||||
|
}
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user