idx int64 | func_before string | Vulnerability Classification string | vul int64 | func_after string | patch string | CWE ID string | lines_before string | lines_after string |
|---|---|---|---|---|---|---|---|---|
5,200 | bool Smb4KGlobal::coreIsRunning()
{
return (Smb4KScanner::self()->isRunning() ||
Smb4KMounter::self()->isRunning() ||
Smb4KPrint::self()->isRunning() ||
Smb4KSynchronizer::self()->isRunning() ||
Smb4KPreviewer::self()->isRunning() ||
Smb4KSearch::self()->isRunning());... | +Priv | 0 | bool Smb4KGlobal::coreIsRunning()
{
return (Smb4KScanner::self()->isRunning() ||
Smb4KMounter::self()->isRunning() ||
Smb4KPrint::self()->isRunning() ||
Smb4KSynchronizer::self()->isRunning() ||
Smb4KPreviewer::self()->isRunning() ||
Smb4KSearch::self()->isRunning());... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,201 | Smb4KHost *Smb4KGlobal::findHost( const QString &name, const QString &workgroup )
{
Smb4KHost *host = NULL;
mutex.lock();
for ( int i = 0; i < p->hostsList.size(); ++i )
{
if ( (workgroup.isEmpty() ||
QString::compare( p->hostsList.at( i )->workgroupName(),
workgroup, Qt::CaseInsensitive... | +Priv | 0 | Smb4KHost *Smb4KGlobal::findHost( const QString &name, const QString &workgroup )
{
Smb4KHost *host = NULL;
mutex.lock();
for ( int i = 0; i < p->hostsList.size(); ++i )
{
if ( (workgroup.isEmpty() ||
QString::compare( p->hostsList.at( i )->workgroupName(),
workgroup, Qt::CaseInsensitive... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,202 | QList<Smb4KShare*> Smb4KGlobal::findInaccessibleShares()
{
QList<Smb4KShare *> inaccessible_shares;
mutex.lock();
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( p->mountedSharesList.at( i )->isInaccessible() )
{
inaccessible_shares.append( p->mountedSharesList.at( i ) );
c... | +Priv | 0 | QList<Smb4KShare*> Smb4KGlobal::findInaccessibleShares()
{
QList<Smb4KShare *> inaccessible_shares;
mutex.lock();
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( p->mountedSharesList.at( i )->isInaccessible() )
{
inaccessible_shares.append( p->mountedSharesList.at( i ) );
c... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,203 | Smb4KShare* Smb4KGlobal::findShareByPath( const QString &path )
{
Smb4KShare *share = NULL;
mutex.lock();
if ( !path.isEmpty() && !p->mountedSharesList.isEmpty() )
{
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( QString::compare( path, p->mountedSharesList.at( i )->path(), Qt::C... | +Priv | 0 | Smb4KShare* Smb4KGlobal::findShareByPath( const QString &path )
{
Smb4KShare *share = NULL;
mutex.lock();
if ( !path.isEmpty() && !p->mountedSharesList.isEmpty() )
{
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( QString::compare( path, p->mountedSharesList.at( i )->path(), Qt::C... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,204 | QList<Smb4KShare *> Smb4KGlobal::findShareByUNC( const QString &unc )
{
QList<Smb4KShare *> list;
mutex.lock();
if ( !unc.isEmpty() && !p->mountedSharesList.isEmpty() )
{
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( QString::compare( unc, p->mountedSharesList.at( i )->unc(), Qt... | +Priv | 0 | QList<Smb4KShare *> Smb4KGlobal::findShareByUNC( const QString &unc )
{
QList<Smb4KShare *> list;
mutex.lock();
if ( !unc.isEmpty() && !p->mountedSharesList.isEmpty() )
{
for ( int i = 0; i < p->mountedSharesList.size(); ++i )
{
if ( QString::compare( unc, p->mountedSharesList.at( i )->unc(), Qt... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,205 | Smb4KWorkgroup *Smb4KGlobal::findWorkgroup( const QString &name )
{
Smb4KWorkgroup *workgroup = NULL;
mutex.lock();
for ( int i = 0; i < p->workgroupsList.size(); ++i )
{
if ( QString::compare( p->workgroupsList.at( i )->workgroupName(),
name, Qt::CaseInsensitive ) == 0 )
{
workgroup = ... | +Priv | 0 | Smb4KWorkgroup *Smb4KGlobal::findWorkgroup( const QString &name )
{
Smb4KWorkgroup *workgroup = NULL;
mutex.lock();
for ( int i = 0; i < p->workgroupsList.size(); ++i )
{
if ( QString::compare( p->workgroupsList.at( i )->workgroupName(),
name, Qt::CaseInsensitive ) == 0 )
{
workgroup = ... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,206 | const QList<Smb4KHost *> &Smb4KGlobal::hostsList()
{
return p->hostsList;
}
| +Priv | 0 | const QList<Smb4KHost *> &Smb4KGlobal::hostsList()
{
return p->hostsList;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,207 | void Smb4KGlobal::initCore(bool modifyCursor, bool initClasses)
{
p->modifyCursor = modifyCursor;
p->setDefaultSettings();
if (initClasses)
{
Smb4KScanner::self()->start();
Smb4KMounter::self()->start();
}
else
{
}
p->makeConnections();
p->coreInitialized = true;
}
| +Priv | 0 | void Smb4KGlobal::initCore(bool modifyCursor, bool initClasses)
{
p->modifyCursor = modifyCursor;
p->setDefaultSettings();
if (initClasses)
{
Smb4KScanner::self()->start();
Smb4KMounter::self()->start();
}
else
{
}
p->makeConnections();
p->coreInitialized = true;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,208 | const QList<Smb4KShare *> &Smb4KGlobal::mountedSharesList()
{
return p->mountedSharesList;
}
| +Priv | 0 | const QList<Smb4KShare *> &Smb4KGlobal::mountedSharesList()
{
return p->mountedSharesList;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,209 | bool Smb4KGlobal::onlyForeignMountedShares()
{
return p->onlyForeignShares;
}
| +Priv | 0 | bool Smb4KGlobal::onlyForeignMountedShares()
{
return p->onlyForeignShares;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,210 | void Smb4KGlobal::openShare( Smb4KShare *share, OpenWith openWith )
{
if ( !share || share->isInaccessible() )
{
return;
}
switch ( openWith )
{
case FileManager:
{
KUrl url;
url.setPath( share->canonicalPath() );
(void) new KRun( url, 0, 0, true );
break;
}
case... | +Priv | 0 | void Smb4KGlobal::openShare( Smb4KShare *share, OpenWith openWith )
{
if ( !share || share->isInaccessible() )
{
return;
}
switch ( openWith )
{
case FileManager:
{
KUrl url;
url.setPath( share->canonicalPath() );
(void) new KRun( url, 0, 0, true );
break;
}
case... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,211 | bool Smb4KGlobal::removeMountedShare( Smb4KShare *share )
{
Q_ASSERT( share );
bool removed = false;
mutex.lock();
int index = p->mountedSharesList.indexOf( share );
if ( index != -1 )
{
delete p->mountedSharesList.takeAt( index );
removed = true;
p->onlyForeignShares = true;
for ( int... | +Priv | 0 | bool Smb4KGlobal::removeMountedShare( Smb4KShare *share )
{
Q_ASSERT( share );
bool removed = false;
mutex.lock();
int index = p->mountedSharesList.indexOf( share );
if ( index != -1 )
{
delete p->mountedSharesList.takeAt( index );
removed = true;
p->onlyForeignShares = true;
for ( int... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,212 | bool Smb4KGlobal::removeShare( Smb4KShare *share )
{
Q_ASSERT( share );
bool removed = false;
mutex.lock();
int index = p->sharesList.indexOf( share );
if ( index != -1 )
{
delete p->sharesList.takeAt( index );
removed = true;
}
else
{
Smb4KShare *s = findShare( share->shareName(), sha... | +Priv | 0 | bool Smb4KGlobal::removeShare( Smb4KShare *share )
{
Q_ASSERT( share );
bool removed = false;
mutex.lock();
int index = p->sharesList.indexOf( share );
if ( index != -1 )
{
delete p->sharesList.takeAt( index );
removed = true;
}
else
{
Smb4KShare *s = findShare( share->shareName(), sha... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,213 | bool Smb4KGlobal::removeWorkgroup( Smb4KWorkgroup *workgroup )
{
Q_ASSERT( workgroup );
bool removed = false;
mutex.lock();
int index = p->workgroupsList.indexOf( workgroup );
if ( index != -1 )
{
delete p->workgroupsList.takeAt( index );
removed = true;
}
else
{
Smb4KWorkgroup *wg = f... | +Priv | 0 | bool Smb4KGlobal::removeWorkgroup( Smb4KWorkgroup *workgroup )
{
Q_ASSERT( workgroup );
bool removed = false;
mutex.lock();
int index = p->workgroupsList.indexOf( workgroup );
if ( index != -1 )
{
delete p->workgroupsList.takeAt( index );
removed = true;
}
else
{
Smb4KWorkgroup *wg = f... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,214 | void Smb4KGlobal::setDefaultSettings()
{
p->setDefaultSettings();
}
| +Priv | 0 | void Smb4KGlobal::setDefaultSettings()
{
p->setDefaultSettings();
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,215 | QList<Smb4KShare *> Smb4KGlobal::sharedResources( Smb4KHost *host )
{
QList<Smb4KShare *> shares;
mutex.lock();
for ( int i = 0; i < p->sharesList.size(); ++i )
{
if ( QString::compare( p->sharesList.at( i )->hostName(), host->hostName(), Qt::CaseInsensitive ) == 0 &&
QString::compare( p->sharesL... | +Priv | 0 | QList<Smb4KShare *> Smb4KGlobal::sharedResources( Smb4KHost *host )
{
QList<Smb4KShare *> shares;
mutex.lock();
for ( int i = 0; i < p->sharesList.size(); ++i )
{
if ( QString::compare( p->sharesList.at( i )->hostName(), host->hostName(), Qt::CaseInsensitive ) == 0 &&
QString::compare( p->sharesL... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,216 | const QList<Smb4KShare *> &Smb4KGlobal::sharesList()
{
return p->sharesList;
}
| +Priv | 0 | const QList<Smb4KShare *> &Smb4KGlobal::sharesList()
{
return p->sharesList;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,217 | QStringList Smb4KGlobal::whitelistedMountArguments()
{
return p->whitelistedMountArguments;
}
| +Priv | 0 | QStringList Smb4KGlobal::whitelistedMountArguments()
{
return p->whitelistedMountArguments;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,218 | const QString Smb4KGlobal::winsServer()
{
QMap<QString,QString> global_opts = p->globalSambaOptions( false );
QString wins_server;
if ( global_opts.contains( "wins server" ) )
{
wins_server = global_opts.value( "wins server" );
}
else
{
if ( global_opts.contains( "wins support" ) &&
(Q... | +Priv | 0 | const QString Smb4KGlobal::winsServer()
{
QMap<QString,QString> global_opts = p->globalSambaOptions( false );
QString wins_server;
if ( global_opts.contains( "wins server" ) )
{
wins_server = global_opts.value( "wins server" );
}
else
{
if ( global_opts.contains( "wins support" ) &&
(Q... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,219 | QList<Smb4KHost *> Smb4KGlobal::workgroupMembers( Smb4KWorkgroup *workgroup )
{
QList<Smb4KHost *> hosts;
mutex.lock();
for ( int i = 0; i < p->hostsList.size(); ++i )
{
if ( QString::compare( p->hostsList.at( i )->workgroupName(), workgroup->workgroupName(), Qt::CaseInsensitive ) == 0 )
{
hosts... | +Priv | 0 | QList<Smb4KHost *> Smb4KGlobal::workgroupMembers( Smb4KWorkgroup *workgroup )
{
QList<Smb4KHost *> hosts;
mutex.lock();
for ( int i = 0; i < p->hostsList.size(); ++i )
{
if ( QString::compare( p->hostsList.at( i )->workgroupName(), workgroup->workgroupName(), Qt::CaseInsensitive ) == 0 )
{
hosts... | @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,220 | const QList<Smb4KWorkgroup *> &Smb4KGlobal::workgroupsList()
{
return p->workgroupsList;
}
| +Priv | 0 | const QList<Smb4KWorkgroup *> &Smb4KGlobal::workgroupsList()
{
return p->workgroupsList;
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,221 | Smb4KGlobal::Smb4KEvent::~Smb4KEvent()
{
}
| +Priv | 0 | Smb4KGlobal::Smb4KEvent::~Smb4KEvent()
{
}
| @@ -2,7 +2,7 @@
smb4kglobal - This is the global namespace for Smb4K.
-------------------
begin : Sa Apr 2 2005
- copyright : (C) 2005-2014 by Alexander Reinholdt
+ copyright : (C) 2005-2017 by Alexander Reinholdt
email ... | CWE-20 | null | null |
5,222 | Smb4KMountJob::Smb4KMountJob( QObject *parent ) : KJob( parent ),
m_started( false ), m_parent_widget( NULL ), m_processed( 0 )
{
setCapabilities( KJob::Killable );
}
| +Priv | 0 | Smb4KMountJob::Smb4KMountJob( QObject *parent ) : KJob( parent ),
m_started( false ), m_parent_widget( NULL ), m_processed( 0 )
{
setCapabilities( KJob::Killable );
}
| @@ -207,30 +207,7 @@ bool Smb4KMountJob::createMountAction(Smb4KShare *share, Action *action)
//
bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map)
{
- // Find the mount program.
- QString mount;
- QStringList paths;
- paths << "/bin";
- paths << "/sbin";
- paths << "/usr/bin";
- pa... | CWE-20 | null | null |
5,223 | void Smb4KMountJob::setupMount( Smb4KShare *share, QWidget *parent )
{
Q_ASSERT( share );
m_shares << new Smb4KShare( *share );
m_parent_widget = parent;
}
| +Priv | 0 | void Smb4KMountJob::setupMount( Smb4KShare *share, QWidget *parent )
{
Q_ASSERT( share );
m_shares << new Smb4KShare( *share );
m_parent_widget = parent;
}
| @@ -207,30 +207,7 @@ bool Smb4KMountJob::createMountAction(Smb4KShare *share, Action *action)
//
bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map)
{
- // Find the mount program.
- QString mount;
- QStringList paths;
- paths << "/bin";
- paths << "/sbin";
- paths << "/usr/bin";
- pa... | CWE-20 | null | null |
5,224 | void Smb4KMountJob::start()
{
m_started = true;
QTimer::singleShot( 50, this, SLOT(slotStartMount()) );
}
| +Priv | 0 | void Smb4KMountJob::start()
{
m_started = true;
QTimer::singleShot( 50, this, SLOT(slotStartMount()) );
}
| @@ -207,30 +207,7 @@ bool Smb4KMountJob::createMountAction(Smb4KShare *share, Action *action)
//
bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map)
{
- // Find the mount program.
- QString mount;
- QStringList paths;
- paths << "/bin";
- paths << "/sbin";
- paths << "/usr/bin";
- pa... | CWE-20 | null | null |
5,225 | Smb4KMountJob::~Smb4KMountJob()
{
while ( !m_shares.isEmpty() )
{
delete m_shares.takeFirst();
}
while ( !m_auth_errors.isEmpty() )
{
delete m_auth_errors.takeFirst();
}
while ( !m_retries.isEmpty() )
{
delete m_retries.takeFirst();
}
}
| +Priv | 0 | Smb4KMountJob::~Smb4KMountJob()
{
while ( !m_shares.isEmpty() )
{
delete m_shares.takeFirst();
}
while ( !m_auth_errors.isEmpty() )
{
delete m_auth_errors.takeFirst();
}
while ( !m_retries.isEmpty() )
{
delete m_retries.takeFirst();
}
}
| @@ -207,30 +207,7 @@ bool Smb4KMountJob::createMountAction(Smb4KShare *share, Action *action)
//
bool Smb4KMountJob::fillArgs(Smb4KShare *share, QMap<QString, QVariant>& map)
{
- // Find the mount program.
- QString mount;
- QStringList paths;
- paths << "/bin";
- paths << "/sbin";
- paths << "/usr/bin";
- pa... | CWE-20 | null | null |
5,226 | Smb4KGlobal::Smb4KEvent::Smb4KEvent(QEvent::Type type): QEvent(type)
{
}
| +Priv | 0 | Smb4KGlobal::Smb4KEvent::Smb4KEvent(QEvent::Type type): QEvent(type)
{
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,227 | bool Smb4KGlobal::addHost(Smb4KHost *host)
{
Q_ASSERT(host);
bool added = false;
mutex.lock();
if (!findHost(host->hostName(), host->workgroupName()))
{
p->hostsList.append(host);
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| +Priv | 0 | bool Smb4KGlobal::addHost(Smb4KHost *host)
{
Q_ASSERT(host);
bool added = false;
mutex.lock();
if (!findHost(host->hostName(), host->workgroupName()))
{
p->hostsList.append(host);
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,228 | bool Smb4KGlobal::addMountedShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool added = false;
if (share)
{
mutex.lock();
if (!findShareByPath(share->path()))
{
p->mountedSharesList.append(share);
added = true;
p->onlyForeignShares = true;
for (Smb4KShare *s : p->mounte... | +Priv | 0 | bool Smb4KGlobal::addMountedShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool added = false;
if (share)
{
mutex.lock();
if (!findShareByPath(share->path()))
{
p->mountedSharesList.append(share);
added = true;
p->onlyForeignShares = true;
for (Smb4KShare *s : p->mounte... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,229 | bool Smb4KGlobal::addShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool added = false;
if (share)
{
mutex.lock();
if (!findShare(share->unc(), share->workgroupName()))
{
p->sharesList.append(share);
added = true;
}
else
{
}
}
else
{
}
mutex.unlock();
retu... | +Priv | 0 | bool Smb4KGlobal::addShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool added = false;
if (share)
{
mutex.lock();
if (!findShare(share->unc(), share->workgroupName()))
{
p->sharesList.append(share);
added = true;
}
else
{
}
}
else
{
}
mutex.unlock();
retu... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,230 | bool Smb4KGlobal::addWorkgroup(Smb4KWorkgroup *workgroup)
{
Q_ASSERT(workgroup);
bool added = false;
mutex.lock();
if (!findWorkgroup(workgroup->workgroupName()))
{
p->workgroupsList.append(workgroup);
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| +Priv | 0 | bool Smb4KGlobal::addWorkgroup(Smb4KWorkgroup *workgroup)
{
Q_ASSERT(workgroup);
bool added = false;
mutex.lock();
if (!findWorkgroup(workgroup->workgroupName()))
{
p->workgroupsList.append(workgroup);
added = true;
}
else
{
}
mutex.unlock();
return added;
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,231 | void Smb4KGlobal::clearHostsList()
{
mutex.lock();
while (!p->hostsList.isEmpty())
{
delete p->hostsList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearHostsList()
{
mutex.lock();
while (!p->hostsList.isEmpty())
{
delete p->hostsList.takeFirst();
}
mutex.unlock();
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,232 | void Smb4KGlobal::clearSharesList()
{
mutex.lock();
while (!p->sharesList.isEmpty())
{
delete p->sharesList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearSharesList()
{
mutex.lock();
while (!p->sharesList.isEmpty())
{
delete p->sharesList.takeFirst();
}
mutex.unlock();
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,233 | void Smb4KGlobal::clearWorkgroupsList()
{
mutex.lock();
while (!p->workgroupsList.isEmpty())
{
delete p->workgroupsList.takeFirst();
}
mutex.unlock();
}
| +Priv | 0 | void Smb4KGlobal::clearWorkgroupsList()
{
mutex.lock();
while (!p->workgroupsList.isEmpty())
{
delete p->workgroupsList.takeFirst();
}
mutex.unlock();
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,234 | QList<Smb4KShare*> Smb4KGlobal::findInaccessibleShares()
{
QList<Smb4KShare *> inaccessibleShares;
mutex.lock();
for (Smb4KShare *s : p->mountedSharesList)
{
if (s->isInaccessible())
{
inaccessibleShares += s;
}
else
{
}
}
mutex.unlock();
return inaccessibleShares;
}
| +Priv | 0 | QList<Smb4KShare*> Smb4KGlobal::findInaccessibleShares()
{
QList<Smb4KShare *> inaccessibleShares;
mutex.lock();
for (Smb4KShare *s : p->mountedSharesList)
{
if (s->isInaccessible())
{
inaccessibleShares += s;
}
else
{
}
}
mutex.unlock();
return inaccessibleShares;
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,235 | Smb4KShare *Smb4KGlobal::findShare(const QString& unc, const QString& workgroup)
{
Smb4KShare *share = 0;
mutex.lock();
for (Smb4KShare *s : p->sharesList)
{
if (QString::compare(s->unc(), unc, Qt::CaseInsensitive) == 0 &&
(workgroup.isEmpty() || QString::compare(s->workgroupName(), workgroup, Q... | +Priv | 0 | Smb4KShare *Smb4KGlobal::findShare(const QString& unc, const QString& workgroup)
{
Smb4KShare *share = 0;
mutex.lock();
for (Smb4KShare *s : p->sharesList)
{
if (QString::compare(s->unc(), unc, Qt::CaseInsensitive) == 0 &&
(workgroup.isEmpty() || QString::compare(s->workgroupName(), workgroup, Q... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,236 | Smb4KShare* Smb4KGlobal::findShareByPath(const QString &path)
{
Smb4KShare *share = 0;
mutex.lock();
if (!path.isEmpty() && !p->mountedSharesList.isEmpty())
{
for (Smb4KShare *s : p->mountedSharesList)
{
if (QString::compare(s->path(), path, Qt::CaseInsensitive) == 0 ||
QString::compar... | +Priv | 0 | Smb4KShare* Smb4KGlobal::findShareByPath(const QString &path)
{
Smb4KShare *share = 0;
mutex.lock();
if (!path.isEmpty() && !p->mountedSharesList.isEmpty())
{
for (Smb4KShare *s : p->mountedSharesList)
{
if (QString::compare(s->path(), path, Qt::CaseInsensitive) == 0 ||
QString::compar... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,237 | QList<Smb4KShare *> Smb4KGlobal::findShareByUNC(const QString &unc)
{
QList<Smb4KShare *> shares;
mutex.lock();
if (!unc.isEmpty() && !p->mountedSharesList.isEmpty())
{
for (Smb4KShare *s : p->mountedSharesList)
{
if (QString::compare(s->unc(), unc, Qt::CaseInsensitive) == 0)
{
sha... | +Priv | 0 | QList<Smb4KShare *> Smb4KGlobal::findShareByUNC(const QString &unc)
{
QList<Smb4KShare *> shares;
mutex.lock();
if (!unc.isEmpty() && !p->mountedSharesList.isEmpty())
{
for (Smb4KShare *s : p->mountedSharesList)
{
if (QString::compare(s->unc(), unc, Qt::CaseInsensitive) == 0)
{
sha... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,238 | const QMap<QString,QString> &Smb4KGlobal::globalSambaOptions(bool read)
{
return p->globalSambaOptions(read);
}
| +Priv | 0 | const QMap<QString,QString> &Smb4KGlobal::globalSambaOptions(bool read)
{
return p->globalSambaOptions(read);
}
| @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,239 | void Smb4KGlobal::openShare(Smb4KShare *share, OpenWith openWith)
{
if (!share || share->isInaccessible())
{
return;
}
switch (openWith)
{
case FileManager:
{
QUrl url = QUrl::fromLocalFile(share->canonicalPath());
(void) new KRun(url, 0);
break;
}
case Konsole:
{
... | +Priv | 0 | void Smb4KGlobal::openShare(Smb4KShare *share, OpenWith openWith)
{
if (!share || share->isInaccessible())
{
return;
}
switch (openWith)
{
case FileManager:
{
QUrl url = QUrl::fromLocalFile(share->canonicalPath());
(void) new KRun(url, 0);
break;
}
case Konsole:
{
... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,240 | bool Smb4KGlobal::removeHost(Smb4KHost *host)
{
Q_ASSERT(host);
bool removed = false;
mutex.lock();
int index = p->hostsList.indexOf(host);
if (index != -1)
{
delete p->hostsList.takeAt(index);
removed = true;
}
else
{
Smb4KHost *h = findHost(host->hostName(), host->workgroupName());
... | +Priv | 0 | bool Smb4KGlobal::removeHost(Smb4KHost *host)
{
Q_ASSERT(host);
bool removed = false;
mutex.lock();
int index = p->hostsList.indexOf(host);
if (index != -1)
{
delete p->hostsList.takeAt(index);
removed = true;
}
else
{
Smb4KHost *h = findHost(host->hostName(), host->workgroupName());
... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,241 | bool Smb4KGlobal::removeMountedShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool removed = false;
if (share)
{
mutex.lock();
QMutableListIterator<Smb4KShare *> it(p->mountedSharesList);
while (it.hasNext())
{
Smb4KShare *s = it.next();
if (QString::compare(s->path()... | +Priv | 0 | bool Smb4KGlobal::removeMountedShare(Smb4KShare *share)
{
Q_ASSERT(share);
bool removed = false;
if (share)
{
mutex.lock();
QMutableListIterator<Smb4KShare *> it(p->mountedSharesList);
while (it.hasNext())
{
Smb4KShare *s = it.next();
if (QString::compare(s->path()... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,242 | bool Smb4KGlobal::removeWorkgroup(Smb4KWorkgroup *workgroup)
{
Q_ASSERT(workgroup);
bool removed = false;
mutex.lock();
int index = p->workgroupsList.indexOf(workgroup);
if (index != -1)
{
delete p->workgroupsList.takeAt(index);
removed = true;
}
else
{
Smb4KWorkgroup *wg = findWorkgro... | +Priv | 0 | bool Smb4KGlobal::removeWorkgroup(Smb4KWorkgroup *workgroup)
{
Q_ASSERT(workgroup);
bool removed = false;
mutex.lock();
int index = p->workgroupsList.indexOf(workgroup);
if (index != -1)
{
delete p->workgroupsList.takeAt(index);
removed = true;
}
else
{
Smb4KWorkgroup *wg = findWorkgro... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,243 | QList<Smb4KShare *> Smb4KGlobal::sharedResources(Smb4KHost *host)
{
QList<Smb4KShare *> shares;
mutex.lock();
for (Smb4KShare *s : p->sharesList)
{
if (QString::compare(s->hostName(), host->hostName(), Qt::CaseInsensitive) == 0 &&
QString::compare(s->workgroupName(), host->workgroupName(), Qt::C... | +Priv | 0 | QList<Smb4KShare *> Smb4KGlobal::sharedResources(Smb4KHost *host)
{
QList<Smb4KShare *> shares;
mutex.lock();
for (Smb4KShare *s : p->sharesList)
{
if (QString::compare(s->hostName(), host->hostName(), Qt::CaseInsensitive) == 0 &&
QString::compare(s->workgroupName(), host->workgroupName(), Qt::C... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,244 | const QString Smb4KGlobal::winsServer()
{
QMap<QString,QString> global_opts = p->globalSambaOptions(false);
QString wins_server;
if (global_opts.contains("wins server"))
{
wins_server = global_opts.value("wins server");
}
else
{
if (global_opts.contains("wins support") &&
(QString::com... | +Priv | 0 | const QString Smb4KGlobal::winsServer()
{
QMap<QString,QString> global_opts = p->globalSambaOptions(false);
QString wins_server;
if (global_opts.contains("wins server"))
{
wins_server = global_opts.value("wins server");
}
else
{
if (global_opts.contains("wins support") &&
(QString::com... | @@ -864,3 +864,35 @@ QStringList Smb4KGlobal::whitelistedMountArguments()
#endif
+const QString Smb4KGlobal::findMountExecutable()
+{
+ QStringList paths;
+ paths << "/bin";
+ paths << "/sbin";
+ paths << "/usr/bin";
+ paths << "/usr/sbin";
+ paths << "/usr/local/bin";
+ paths << "/usr/local/sbin";
+
+#if d... | CWE-20 | null | null |
5,245 | void Smb4KMounter::abortAll()
{
if (!QCoreApplication::closingDown())
{
QListIterator<KJob *> it(subjobs());
while (it.hasNext())
{
it.next()->kill(KJob::EmitResult);
}
}
else
{
}
}
| +Priv | 0 | void Smb4KMounter::abortAll()
{
if (!QCoreApplication::closingDown())
{
QListIterator<KJob *> it(subjobs());
while (it.hasNext())
{
it.next()->kill(KJob::EmitResult);
}
}
else
{
}
}
| @@ -1104,16 +1104,7 @@ void Smb4KMounter::timerEvent(QTimerEvent *)
bool Smb4KMounter::fillMountActionArgs(Smb4KShare *share, QVariantMap& map)
{
// Find the mount program.
- QString mount;
- QStringList paths;
- paths << "/bin";
- paths << "/sbin";
- paths << "/usr/bin";
- paths << "/usr/sbin";
- paths << ... | CWE-20 | null | null |
5,246 | check_file_permissions(i_ctx_t *i_ctx_p, const char *fname, int len,
const char *permitgroup)
{
char fname_reduced[gp_file_name_sizeof];
uint rlen = sizeof(fname_reduced);
if (gp_file_name_reduce(fname, len, fname_reduced, &rlen) != gp_combine_success)
return gs_error_invali... | +Info | 0 | check_file_permissions(i_ctx_t *i_ctx_p, const char *fname, int len,
const char *permitgroup)
{
char fname_reduced[gp_file_name_sizeof];
uint rlen = sizeof(fname_reduced);
if (gp_file_name_reduce(fname, len, fname_reduced, &rlen) != gp_combine_success)
return gs_error_invali... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,247 | check_file_permissions_aux(i_ctx_t *i_ctx_p, char *fname, uint flen)
{ /* i_ctx_p is NULL running init files. */
/* fname must be reduced. */
if (i_ctx_p == NULL)
return 0;
if (check_file_permissions_reduced(i_ctx_p, fname, flen, "PermitFileReading") < 0)
return_error(gs_error_invalidfilea... | +Info | 0 | check_file_permissions_aux(i_ctx_t *i_ctx_p, char *fname, uint flen)
{ /* i_ctx_p is NULL running init files. */
/* fname must be reduced. */
if (i_ctx_p == NULL)
return 0;
if (check_file_permissions_reduced(i_ctx_p, fname, flen, "PermitFileReading") < 0)
return_error(gs_error_invalidfilea... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,248 | check_file_permissions_reduced(i_ctx_t *i_ctx_p, const char *fname, int len,
const char *permitgroup)
{
long i;
ref *permitlist = NULL;
/* an empty string (first character == 0) if '\' character is */
/* recognized as a file name separator as on DOS & Windows */
const char... | +Info | 0 | check_file_permissions_reduced(i_ctx_t *i_ctx_p, const char *fname, int len,
const char *permitgroup)
{
long i;
ref *permitlist = NULL;
/* an empty string (first character == 0) if '\' character is */
/* recognized as a file name separator as on DOS & Windows */
const char... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,249 | file_close(ref * pfile)
{
stream *s;
if (file_is_valid(s, pfile)) { /* closing a closed file is a no-op */
if (sclose(s))
return_error(gs_error_ioerror);
}
return 0;
}
| +Info | 0 | file_close(ref * pfile)
{
stream *s;
if (file_is_valid(s, pfile)) { /* closing a closed file is a no-op */
if (sclose(s))
return_error(gs_error_ioerror);
}
return 0;
}
| @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,250 | file_continue(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
es_ptr pscratch = esp - 2;
file_enum *pfen = r_ptr(esp - 1, file_enum);
int devlen = esp[-3].value.intval;
gx_io_device *iodev = r_ptr(esp - 4, gx_io_device);
uint len = r_size(pscratch);
uint code;
if (len < devlen)
return_erro... | +Info | 0 | file_continue(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
es_ptr pscratch = esp - 2;
file_enum *pfen = r_ptr(esp - 1, file_enum);
int devlen = esp[-3].value.intval;
gx_io_device *iodev = r_ptr(esp - 4, gx_io_device);
uint len = r_size(pscratch);
uint code;
if (len < devlen)
return_erro... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,251 | file_read_string(const byte *str, uint len, ref *pfile, gs_ref_memory_t *imem)
{
stream *s = file_alloc_stream((gs_memory_t *)imem, "file_read_string");
if (s == 0)
return_error(gs_error_VMerror);
sread_string(s, str, len);
s->foreign = 1;
s->write_id = 0;
make_file(pfile, a_readonly | ... | +Info | 0 | file_read_string(const byte *str, uint len, ref *pfile, gs_ref_memory_t *imem)
{
stream *s = file_alloc_stream((gs_memory_t *)imem, "file_read_string");
if (s == 0)
return_error(gs_error_VMerror);
sread_string(s, str, len);
s->foreign = 1;
s->write_id = 0;
make_file(pfile, a_readonly | ... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,252 | filter_open(const char *file_access, uint buffer_size, ref * pfile,
const stream_procs * procs, const stream_template * templat,
const stream_state * st, gs_memory_t *mem)
{
stream *s;
uint ssize = gs_struct_type_size(templat->stype);
stream_state *sst = 0;
int code;
if (tem... | +Info | 0 | filter_open(const char *file_access, uint buffer_size, ref * pfile,
const stream_procs * procs, const stream_template * templat,
const stream_state * st, gs_memory_t *mem)
{
stream *s;
uint ssize = gs_struct_type_size(templat->stype);
stream_state *sst = 0;
int code;
if (tem... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,253 | filter_report_error(stream_state * st, const char *str)
{
if_debug1m('s', st->memory, "[s]stream error: %s\n", str);
strncpy(st->error_string, str, STREAM_MAX_ERROR_STRING);
/* Ensure null termination. */
st->error_string[STREAM_MAX_ERROR_STRING] = 0;
return 0;
}
| +Info | 0 | filter_report_error(stream_state * st, const char *str)
{
if_debug1m('s', st->memory, "[s]stream error: %s\n", str);
strncpy(st->error_string, str, STREAM_MAX_ERROR_STRING);
/* Ensure null termination. */
st->error_string[STREAM_MAX_ERROR_STRING] = 0;
return 0;
}
| @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,254 | iodev_os_open_file(gx_io_device * iodev, const char *fname, uint len,
const char *file_access, stream ** ps, gs_memory_t * mem)
{
return file_open_stream(fname, len, file_access,
file_default_buffer_size, ps,
iodev, iodev->procs.gp_fopen, me... | +Info | 0 | iodev_os_open_file(gx_io_device * iodev, const char *fname, uint len,
const char *file_access, stream ** ps, gs_memory_t * mem)
{
return file_open_stream(fname, len, file_access,
file_default_buffer_size, ps,
iodev, iodev->procs.gp_fopen, me... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,255 | lib_file_open(gs_file_path_ptr lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx_p,
const char *fname, uint flen, char *buffer, int blen, uint *pclen, ref *pfile)
{ /* i_ctx_p is NULL running arg (@) files.
* lib_path and mem are never NULL
*/
bool starting_arg_file = (i_ctx_p == ... | +Info | 0 | lib_file_open(gs_file_path_ptr lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx_p,
const char *fname, uint flen, char *buffer, int blen, uint *pclen, ref *pfile)
{ /* i_ctx_p is NULL running arg (@) files.
* lib_path and mem are never NULL
*/
bool starting_arg_file = (i_ctx_p == ... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,256 | lib_file_open_search_with_combine(gs_file_path_ptr lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx_p,
const char *fname, uint flen, char *buffer, int blen, uint *pclen, ref *pfile,
gx_io_device *iodev, bool starting_arg_file, char *fmode)
{
strea... | +Info | 0 | lib_file_open_search_with_combine(gs_file_path_ptr lib_path, const gs_memory_t *mem, i_ctx_t *i_ctx_p,
const char *fname, uint flen, char *buffer, int blen, uint *pclen, ref *pfile,
gx_io_device *iodev, bool starting_arg_file, char *fmode)
{
strea... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,257 | lib_fopen(const gs_file_path_ptr pfpath, const gs_memory_t *mem, const char *fname)
{
/* We need a buffer to hold the expanded file name. */
char filename_found[DEFAULT_BUFFER_SIZE];
FILE *file = NULL;
uint fnamelen;
ref obj;
int code;
/* open the usual 'stream', then if successful, return ... | +Info | 0 | lib_fopen(const gs_file_path_ptr pfpath, const gs_memory_t *mem, const char *fname)
{
/* We need a buffer to hold the expanded file name. */
char filename_found[DEFAULT_BUFFER_SIZE];
FILE *file = NULL;
uint fnamelen;
ref obj;
int code;
/* open the usual 'stream', then if successful, return ... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,258 | make_stream_file(ref * pfile, stream * s, const char *access)
{
uint attrs =
(access[1] == '+' ? a_write + a_read + a_execute : 0) |
imemory_space((gs_ref_memory_t *) s->memory);
if (access[0] == 'r') {
make_file(pfile, attrs | (a_read | a_execute), s->read_id, s);
s->write_id =... | +Info | 0 | make_stream_file(ref * pfile, stream * s, const char *access)
{
uint attrs =
(access[1] == '+' ? a_write + a_read + a_execute : 0) |
imemory_space((gs_ref_memory_t *) s->memory);
if (access[0] == 'r') {
make_file(pfile, attrs | (a_read | a_execute), s->read_id, s);
s->write_id =... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,259 | parse_real_file_name(const ref *op, gs_parsed_file_name_t *pfn,
gs_memory_t *mem, client_name_t cname)
{
check_read_type(*op, t_string);
return gs_parse_real_file_name(pfn, (const char *)op->value.const_bytes,
r_size(op), mem, cname);
}
| +Info | 0 | parse_real_file_name(const ref *op, gs_parsed_file_name_t *pfn,
gs_memory_t *mem, client_name_t cname)
{
check_read_type(*op, t_string);
return gs_parse_real_file_name(pfn, (const char *)op->value.const_bytes,
r_size(op), mem, cname);
}
| @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,260 | zdeletefile(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gs_parsed_file_name_t pname;
int code = parse_real_file_name(op, &pname, imemory, "deletefile");
if (code < 0)
return code;
if (pname.iodev == iodev_default(imemory)) {
if ((code = check_file_permissions(i_ctx_p, pname.fname, pname.le... | +Info | 0 | zdeletefile(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
gs_parsed_file_name_t pname;
int code = parse_real_file_name(op, &pname, imemory, "deletefile");
if (code < 0)
return code;
if (pname.iodev == iodev_default(imemory)) {
if ((code = check_file_permissions(i_ctx_p, pname.fname, pname.le... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,261 | static int zgetfilename(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint fnlen;
gs_const_string pfname;
stream *s;
byte *sbody;
int code;
check_ostack(1);
check_read_type(*op, t_file);
s = (op)->value.pfile;
code = sfilename(s, &pfname);
if (code < 0) {
pfname.size = 0;
... | +Info | 0 | static int zgetfilename(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
uint fnlen;
gs_const_string pfname;
stream *s;
byte *sbody;
int code;
check_ostack(1);
check_read_type(*op, t_file);
s = (op)->value.pfile;
code = sfilename(s, &pfname);
if (code < 0) {
pfname.size = 0;
... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,262 | zrenamefile(i_ctx_t *i_ctx_p)
{
int code;
os_ptr op = osp;
gs_parsed_file_name_t pname1, pname2;
code = parse_real_file_name(op, &pname2, imemory, "renamefile(to)");
if (code < 0)
return code;
pname1.fname = 0;
code = parse_real_file_name(op - 1, &pname1, imemory, "renamefile(from)... | +Info | 0 | zrenamefile(i_ctx_t *i_ctx_p)
{
int code;
os_ptr op = osp;
gs_parsed_file_name_t pname1, pname2;
code = parse_real_file_name(op, &pname2, imemory, "renamefile(to)");
if (code < 0)
return code;
pname1.fname = 0;
code = parse_real_file_name(op - 1, &pname1, imemory, "renamefile(from)... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,263 | ztempfile(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
const char *pstr;
char fmode[4];
int code = parse_file_access_string(op, fmode);
char *prefix = NULL;
char *fname= NULL;
uint fnlen;
FILE *sfile;
stream *s;
byte *buf, *sbody;
if (code < 0)
return code;
prefix = (cha... | +Info | 0 | ztempfile(i_ctx_t *i_ctx_p)
{
os_ptr op = osp;
const char *pstr;
char fmode[4];
int code = parse_file_access_string(op, fmode);
char *prefix = NULL;
char *fname= NULL;
uint fnlen;
FILE *sfile;
stream *s;
byte *buf, *sbody;
if (code < 0)
return code;
prefix = (cha... | @@ -209,10 +209,13 @@ z_check_file_permissions(gs_memory_t *mem, const char *fname, const int len, con
if (code < 0)
return code;
- if (pname.iodev && i_ctx_p->LockFilePermissions && strcmp(pname.iodev->dname, "%pipe%") == 0)
- return gs_error_invalidfileaccess;
-
- code = check_fil... | CWE-200 | null | null |
5,264 | AviaryScheddPlugin::earlyInitialize()
{
static bool skip = false;
if (skip) return; skip = true;
string log_name;
sprintf(log_name,"aviary_job.log");
string myname = "job@" + getScheddName();
provider = AviaryProviderFactory::create(log_name,myname,
"SCHEDULER","JOB","services/job/");
i... | DoS | 0 | AviaryScheddPlugin::earlyInitialize()
{
static bool skip = false;
if (skip) return; skip = true;
string log_name;
sprintf(log_name,"aviary_job.log");
string myname = "job@" + getScheddName();
provider = AviaryProviderFactory::create(log_name,myname,
"SCHEDULER","JOB","services/job/");
i... | @@ -268,7 +268,7 @@ AviaryScheddPlugin::processJob(const char *key,
// dprintf(D_FULLDEBUG, "Processing: %s\n", key);
id = getProcByString(key);
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipp... | CWE-20 | null | null |
5,265 | AviaryScheddPlugin::markDirty(const char *key,
const char *name,
const char *value)
{
if (!IS_JOB(key)) return;
if (!(strcasecmp(name, ATTR_JOB_STATUS) == 0 ||
strcasecmp(name, ATTR_LAST_JOB_STATUS) == 0)) return;
DirtyJobStatus status(name, atoi(value));
DirtyJobEntry entry(key, status);
dirtyJ... | DoS | 0 | AviaryScheddPlugin::markDirty(const char *key,
const char *name,
const char *value)
{
if (!IS_JOB(key)) return;
if (!(strcasecmp(name, ATTR_JOB_STATUS) == 0 ||
strcasecmp(name, ATTR_LAST_JOB_STATUS) == 0)) return;
DirtyJobStatus status(name, atoi(value));
DirtyJobEntry entry(key, status);
dirtyJ... | @@ -268,7 +268,7 @@ AviaryScheddPlugin::processJob(const char *key,
// dprintf(D_FULLDEBUG, "Processing: %s\n", key);
id = getProcByString(key);
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipp... | CWE-20 | null | null |
5,266 | AviaryScheddPlugin::shutdown()
{
static bool skip = false;
if (skip) return; skip = true;
dprintf(D_FULLDEBUG, "AviaryScheddPlugin: shutting down...\n");
if (schedulerObj) {
delete schedulerObj;
schedulerObj = NULL;
}
if (provider) {
provider->invalidate();
delete provider;
provider = NULL;
}
}
| DoS | 0 | AviaryScheddPlugin::shutdown()
{
static bool skip = false;
if (skip) return; skip = true;
dprintf(D_FULLDEBUG, "AviaryScheddPlugin: shutting down...\n");
if (schedulerObj) {
delete schedulerObj;
schedulerObj = NULL;
}
if (provider) {
provider->invalidate();
delete provider;
provider = NULL;
}
}
| @@ -268,7 +268,7 @@ AviaryScheddPlugin::processJob(const char *key,
// dprintf(D_FULLDEBUG, "Processing: %s\n", key);
id = getProcByString(key);
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipp... | CWE-20 | null | null |
5,267 | AviaryScheddPlugin::update(int cmd, const ClassAd *ad)
{
MyString hashKey;
switch (cmd) {
case UPDATE_SCHEDD_AD:
dprintf(D_FULLDEBUG, "Received UPDATE_SCHEDD_AD\n");
schedulerObj->update(*ad);
break;
default:
dprintf(D_FULLDEBUG, "Unsupported command: %s\n",
getCollectorCommandString(cmd));
}
}
| DoS | 0 | AviaryScheddPlugin::update(int cmd, const ClassAd *ad)
{
MyString hashKey;
switch (cmd) {
case UPDATE_SCHEDD_AD:
dprintf(D_FULLDEBUG, "Received UPDATE_SCHEDD_AD\n");
schedulerObj->update(*ad);
break;
default:
dprintf(D_FULLDEBUG, "Unsupported command: %s\n",
getCollectorCommandString(cmd));
}
}
| @@ -268,7 +268,7 @@ AviaryScheddPlugin::processJob(const char *key,
// dprintf(D_FULLDEBUG, "Processing: %s\n", key);
id = getProcByString(key);
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLDEBUG, "Failed to parse key: %s - skipp... | CWE-20 | null | null |
5,268 | SchedulerObject::SchedulerObject()
{
m_pool = getPoolName();
m_name = getScheddName();
m_codec = new BaseCodec();
}
| DoS | 0 | SchedulerObject::SchedulerObject()
{
m_pool = getPoolName();
m_name = getScheddName();
m_codec = new BaseCodec();
}
| @@ -263,7 +263,7 @@ SchedulerObject::setAttribute(std::string key,
std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLD... | CWE-20 | null | null |
5,269 | SchedulerObject* SchedulerObject::getInstance()
{
if (!m_instance) {
m_instance = new SchedulerObject();
}
return m_instance;
}
| DoS | 0 | SchedulerObject* SchedulerObject::getInstance()
{
if (!m_instance) {
m_instance = new SchedulerObject();
}
return m_instance;
}
| @@ -263,7 +263,7 @@ SchedulerObject::setAttribute(std::string key,
std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLD... | CWE-20 | null | null |
5,270 | SchedulerObject::~SchedulerObject()
{
delete m_codec;
}
| DoS | 0 | SchedulerObject::~SchedulerObject()
{
delete m_codec;
}
| @@ -263,7 +263,7 @@ SchedulerObject::setAttribute(std::string key,
std::string &text)
{
PROC_ID id = getProcByString(key.c_str());
- if (id.cluster < 0 || id.proc < 0) {
+ if (id.cluster <= 0 || id.proc < 0) {
dprintf(D_FULLD... | CWE-20 | null | null |
5,271 | T1_Done_Blend( T1_Face face )
{
FT_Memory memory = face->root.memory;
PS_Blend blend = face->blend;
if ( blend )
{
FT_UInt num_designs = blend->num_designs;
FT_UInt num_axis = blend->num_axis;
FT_UInt n;
/* release design pos table */
FT_FREE( blend->desi... | DoS | 0 | T1_Done_Blend( T1_Face face )
{
FT_Memory memory = face->root.memory;
PS_Blend blend = face->blend;
if ( blend )
{
FT_UInt num_designs = blend->num_designs;
FT_UInt num_axis = blend->num_axis;
FT_UInt n;
/* release design pos table */
FT_FREE( blend->desi... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,272 | T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master )
{
FT_Memory memory = face->root.memory;
FT_MM_Var *mmvar = NULL;
FT_Multi_Master mmaster;
FT_Error error;
FT_UInt i;
FT_Fixed axiscoords[T1_MAX_MM_AXIS];
PS_Blend blend... | DoS | 0 | T1_Get_MM_Var( T1_Face face,
FT_MM_Var* *master )
{
FT_Memory memory = face->root.memory;
FT_MM_Var *mmvar = NULL;
FT_Multi_Master mmaster;
FT_Error error;
FT_UInt i;
FT_Fixed axiscoords[T1_MAX_MM_AXIS];
PS_Blend blend... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,273 | T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
{
FT_Long lcoords[4]; /* maximum axis count is 4 */
FT_UInt i;
FT_Error error;
error = FT_ERR( Invalid_Argument );
if ( num_coords <= 4 && num_coords > 0 ... | DoS | 0 | T1_Set_Var_Design( T1_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
{
FT_Long lcoords[4]; /* maximum axis count is 4 */
FT_UInt i;
FT_Error error;
error = FT_ERR( Invalid_Argument );
if ( num_coords <= 4 && num_coords > 0 ... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,274 | mm_axis_unmap( PS_DesignMap axismap,
FT_Fixed ncv )
{
int j;
if ( ncv <= axismap->blend_points[0] )
return INT_TO_FIXED( axismap->design_points[0] );
for ( j = 1; j < axismap->num_points; ++j )
{
if ( ncv <= axismap->blend_points[j] )
return INT_TO_FIXE... | DoS | 0 | mm_axis_unmap( PS_DesignMap axismap,
FT_Fixed ncv )
{
int j;
if ( ncv <= axismap->blend_points[0] )
return INT_TO_FIXED( axismap->design_points[0] );
for ( j = 1; j < axismap->num_points; ++j )
{
if ( ncv <= axismap->blend_points[j] )
return INT_TO_FIXE... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,275 | mm_weights_unmap( FT_Fixed* weights,
FT_Fixed* axiscoords,
FT_UInt axis_count )
{
FT_ASSERT( axis_count <= T1_MAX_MM_AXIS );
if ( axis_count == 1 )
axiscoords[0] = weights[1];
else if ( axis_count == 2 )
{
axiscoords[0] = weights[3] + weight... | DoS | 0 | mm_weights_unmap( FT_Fixed* weights,
FT_Fixed* axiscoords,
FT_UInt axis_count )
{
FT_ASSERT( axis_count <= T1_MAX_MM_AXIS );
if ( axis_count == 1 )
axiscoords[0] = weights[1];
else if ( axis_count == 2 )
{
axiscoords[0] = weights[3] + weight... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,276 | parse_blend_design_map( T1_Face face,
T1_Loader loader )
{
FT_Error error = FT_Err_Ok;
T1_Parser parser = &loader->parser;
PS_Blend blend;
T1_TokenRec axis_tokens[T1_MAX_MM_AXIS];
FT_Int n, num_axis;
FT_Byte* old_cursor;
FT_Byte* o... | DoS | 0 | parse_blend_design_map( T1_Face face,
T1_Loader loader )
{
FT_Error error = FT_Err_Ok;
T1_Parser parser = &loader->parser;
PS_Blend blend;
T1_TokenRec axis_tokens[T1_MAX_MM_AXIS];
FT_Int n, num_axis;
FT_Byte* old_cursor;
FT_Byte* o... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,277 | parse_blend_design_positions( T1_Face face,
T1_Loader loader )
{
T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS];
FT_Int num_designs;
FT_Int num_axis;
T1_Parser parser = &loader->parser;
FT_Error error = FT_Err_Ok;
PS_Blend blend;
... | DoS | 0 | parse_blend_design_positions( T1_Face face,
T1_Loader loader )
{
T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS];
FT_Int num_designs;
FT_Int num_axis;
T1_Parser parser = &loader->parser;
FT_Error error = FT_Err_Ok;
PS_Blend blend;
... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,278 | parse_buildchar( T1_Face face,
T1_Loader loader )
{
face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 );
return;
}
| DoS | 0 | parse_buildchar( T1_Face face,
T1_Loader loader )
{
face->len_buildchar = T1_ToFixedArray( &loader->parser, 0, NULL, 0 );
return;
}
| @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,279 | parse_private( T1_Face face,
T1_Loader loader )
{
FT_UNUSED( face );
loader->keywords_encountered |= T1_PRIVATE;
}
| DoS | 0 | parse_private( T1_Face face,
T1_Loader loader )
{
FT_UNUSED( face );
loader->keywords_encountered |= T1_PRIVATE;
}
| @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,280 | parse_weight_vector( T1_Face face,
T1_Loader loader )
{
T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS];
FT_Int num_designs;
FT_Error error = FT_Err_Ok;
T1_Parser parser = &loader->parser;
PS_Blend blend = face->blend;
T1_Token token;
FT_In... | DoS | 0 | parse_weight_vector( T1_Face face,
T1_Loader loader )
{
T1_TokenRec design_tokens[T1_MAX_MM_DESIGNS];
FT_Int num_designs;
FT_Error error = FT_Err_Ok;
T1_Parser parser = &loader->parser;
PS_Blend blend = face->blend;
T1_Token token;
FT_In... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,281 | t1_allocate_blend( T1_Face face,
FT_UInt num_designs,
FT_UInt num_axis )
{
PS_Blend blend;
FT_Memory memory = face->root.memory;
FT_Error error = FT_Err_Ok;
blend = face->blend;
if ( !blend )
{
if ( FT_NEW( blend ) )
goto Exi... | DoS | 0 | t1_allocate_blend( T1_Face face,
FT_UInt num_designs,
FT_UInt num_axis )
{
PS_Blend blend;
FT_Memory memory = face->root.memory;
FT_Error error = FT_Err_Ok;
blend = face->blend;
if ( !blend )
{
if ( FT_NEW( blend ) )
goto Exi... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,282 | t1_load_keyword( T1_Face face,
T1_Loader loader,
const T1_Field field )
{
FT_Error error;
void* dummy_object;
void** objects;
FT_UInt max_objects;
PS_Blend blend = face->blend;
if ( blend && blend->num_designs == 0 )
ble... | DoS | 0 | t1_load_keyword( T1_Face face,
T1_Loader loader,
const T1_Field field )
{
FT_Error error;
void* dummy_object;
void** objects;
FT_UInt max_objects;
PS_Blend blend = face->blend;
if ( blend && blend->num_designs == 0 )
ble... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,283 | t1_parse_font_matrix( T1_Face face,
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Matrix* matrix = &face->type1.font_matrix;
FT_Vector* offset = &face->type1.font_offset;
FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6];
FT_Fixed ... | DoS | 0 | t1_parse_font_matrix( T1_Face face,
T1_Loader loader )
{
T1_Parser parser = &loader->parser;
FT_Matrix* matrix = &face->type1.font_matrix;
FT_Vector* offset = &face->type1.font_offset;
FT_Face root = (FT_Face)&face->root;
FT_Fixed temp[6];
FT_Fixed ... | @@ -1274,6 +1274,13 @@
{
charcode = (FT_Int)T1_ToInt( parser );
T1_Skip_Spaces( parser );
+
+ /* protect against invalid charcode */
+ if ( cur == parser->root.cursor )
+ {
+ parser->root.error = FT_THROW( Unknown_File_Format );
+ ... | CWE-399 | null | null |
5,284 | static void ahci_init_d2h(AHCIDevice *ad)
{
uint8_t init_fis[20];
IDEState *ide_state = &ad->port.ifs[0];
memset(init_fis, 0, sizeof(init_fis));
init_fis[4] = 1;
init_fis[12] = 1;
if (ide_state->drive_kind == IDE_CD) {
init_fis[5] = ide_state->lcyl;
init_fis[6] = ide_state->hc... | DoS | 0 | static void ahci_init_d2h(AHCIDevice *ad)
{
uint8_t init_fis[20];
IDEState *ide_state = &ad->port.ifs[0];
memset(init_fis, 0, sizeof(init_fis));
init_fis[4] = 1;
init_fis[12] = 1;
if (ide_state->drive_kind == IDE_CD) {
init_fis[5] = ide_state->lcyl;
init_fis[6] = ide_state->hc... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,285 | static void ahci_irq_lower(AHCIState *s, AHCIDevice *dev)
{
AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
PCIDevice *pci_dev =
(PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
DPRINTF(0, "lower irq\n");
if (!pci_dev || !msi_enabled(pci_dev)) {
qemu_irq_lower(s->ir... | DoS | 0 | static void ahci_irq_lower(AHCIState *s, AHCIDevice *dev)
{
AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
PCIDevice *pci_dev =
(PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
DPRINTF(0, "lower irq\n");
if (!pci_dev || !msi_enabled(pci_dev)) {
qemu_irq_lower(s->ir... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,286 | static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
{
AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
PCIDevice *pci_dev =
(PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
DPRINTF(0, "raise irq\n");
if (pci_dev && msi_enabled(pci_dev)) {
msi_notify(pci_dev, 0)... | DoS | 0 | static void ahci_irq_raise(AHCIState *s, AHCIDevice *dev)
{
AHCIPCIState *d = container_of(s, AHCIPCIState, ahci);
PCIDevice *pci_dev =
(PCIDevice *)object_dynamic_cast(OBJECT(d), TYPE_PCI_DEVICE);
DPRINTF(0, "raise irq\n");
if (pci_dev && msi_enabled(pci_dev)) {
msi_notify(pci_dev, 0)... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,287 | static uint64_t ahci_mem_read(void *opaque, hwaddr addr,
unsigned size)
{
AHCIState *s = opaque;
uint32_t val = 0;
if (addr < AHCI_GENERIC_HOST_CONTROL_REGS_MAX_ADDR) {
switch (addr) {
case HOST_CAP:
val = s->control_regs.cap;
break;
... | DoS | 0 | static uint64_t ahci_mem_read(void *opaque, hwaddr addr,
unsigned size)
{
AHCIState *s = opaque;
uint32_t val = 0;
if (addr < AHCI_GENERIC_HOST_CONTROL_REGS_MAX_ADDR) {
switch (addr) {
case HOST_CAP:
val = s->control_regs.cap;
break;
... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,288 | static void ahci_mem_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
AHCIState *s = opaque;
/* Only aligned reads are allowed on AHCI */
if (addr & 3) {
fprintf(stderr, "ahci: Mis-aligned write to addr 0x"
TARGET_FMT_plx "\n", addr);
... | DoS | 0 | static void ahci_mem_write(void *opaque, hwaddr addr,
uint64_t val, unsigned size)
{
AHCIState *s = opaque;
/* Only aligned reads are allowed on AHCI */
if (addr & 3) {
fprintf(stderr, "ahci: Mis-aligned write to addr 0x"
TARGET_FMT_plx "\n", addr);
... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,289 | static uint32_t ahci_port_read(AHCIState *s, int port, int offset)
{
uint32_t val;
AHCIPortRegs *pr;
pr = &s->dev[port].port_regs;
switch (offset) {
case PORT_LST_ADDR:
val = pr->lst_addr;
break;
case PORT_LST_ADDR_HI:
val = pr->lst_addr_hi;
break;
case PORT... | DoS | 0 | static uint32_t ahci_port_read(AHCIState *s, int port, int offset)
{
uint32_t val;
AHCIPortRegs *pr;
pr = &s->dev[port].port_regs;
switch (offset) {
case PORT_LST_ADDR:
val = pr->lst_addr;
break;
case PORT_LST_ADDR_HI:
val = pr->lst_addr_hi;
break;
case PORT... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,290 | static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val);
switch (offset) {
case PORT_LST_ADDR:
pr->lst_addr = val;
map_page(s->as, &s->dev[port].lst,
... | DoS | 0 | static void ahci_port_write(AHCIState *s, int port, int offset, uint32_t val)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
DPRINTF(port, "offset: 0x%x val: 0x%x\n", offset, val);
switch (offset) {
case PORT_LST_ADDR:
pr->lst_addr = val;
map_page(s->as, &s->dev[port].lst,
... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,291 | static void ahci_reg_init(AHCIState *s)
{
int i;
s->control_regs.cap = (s->ports - 1) |
(AHCI_NUM_COMMAND_SLOTS << 8) |
(AHCI_SUPPORTED_SPEED_GEN1 << AHCI_SUPPORTED_SPEED) |
HOST_CAP_NCQ | HOST_CAP_AHCI;
s->control_regs.impl = (... | DoS | 0 | static void ahci_reg_init(AHCIState *s)
{
int i;
s->control_regs.cap = (s->ports - 1) |
(AHCI_NUM_COMMAND_SLOTS << 8) |
(AHCI_SUPPORTED_SPEED_GEN1 << AHCI_SUPPORTED_SPEED) |
HOST_CAP_NCQ | HOST_CAP_AHCI;
s->control_regs.impl = (... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,292 | static void ahci_reset_port(AHCIState *s, int port)
{
AHCIDevice *d = &s->dev[port];
AHCIPortRegs *pr = &d->port_regs;
IDEState *ide_state = &d->port.ifs[0];
int i;
DPRINTF(port, "reset port\n");
ide_bus_reset(&d->port);
ide_state->ncq_queues = AHCI_MAX_CMDS;
pr->scr_stat = 0;
pr-... | DoS | 0 | static void ahci_reset_port(AHCIState *s, int port)
{
AHCIDevice *d = &s->dev[port];
AHCIPortRegs *pr = &d->port_regs;
IDEState *ide_state = &d->port.ifs[0];
int i;
DPRINTF(port, "reset port\n");
ide_bus_reset(&d->port);
ide_state->ncq_queues = AHCI_MAX_CMDS;
pr->scr_stat = 0;
pr-... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,293 | static void ahci_write_fis_d2h(AHCIDevice *ad, uint8_t *cmd_fis)
{
AHCIPortRegs *pr = &ad->port_regs;
uint8_t *d2h_fis;
int i;
dma_addr_t cmd_len = 0x80;
int cmd_mapped = 0;
IDEState *s = &ad->port.ifs[0];
if (!ad->res_fis || !(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
if (!c... | DoS | 0 | static void ahci_write_fis_d2h(AHCIDevice *ad, uint8_t *cmd_fis)
{
AHCIPortRegs *pr = &ad->port_regs;
uint8_t *d2h_fis;
int i;
dma_addr_t cmd_len = 0x80;
int cmd_mapped = 0;
IDEState *s = &ad->port.ifs[0];
if (!ad->res_fis || !(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
if (!c... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,294 | static void ahci_write_fis_pio(AHCIDevice *ad, uint16_t len)
{
AHCIPortRegs *pr = &ad->port_regs;
uint8_t *pio_fis, *cmd_fis;
uint64_t tbl_addr;
dma_addr_t cmd_len = 0x80;
IDEState *s = &ad->port.ifs[0];
if (!ad->res_fis || !(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
/* map cmd_f... | DoS | 0 | static void ahci_write_fis_pio(AHCIDevice *ad, uint16_t len)
{
AHCIPortRegs *pr = &ad->port_regs;
uint8_t *pio_fis, *cmd_fis;
uint64_t tbl_addr;
dma_addr_t cmd_len = 0x80;
IDEState *s = &ad->port.ifs[0];
if (!ad->res_fis || !(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
/* map cmd_f... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,295 | static void ahci_write_fis_sdb(AHCIState *s, int port, uint32_t finished)
{
AHCIDevice *ad = &s->dev[port];
AHCIPortRegs *pr = &ad->port_regs;
IDEState *ide_state;
SDBFIS *sdb_fis;
if (!s->dev[port].res_fis ||
!(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
sdb_fis = (SDBFIS *)&a... | DoS | 0 | static void ahci_write_fis_sdb(AHCIState *s, int port, uint32_t finished)
{
AHCIDevice *ad = &s->dev[port];
AHCIPortRegs *pr = &ad->port_regs;
IDEState *ide_state;
SDBFIS *sdb_fis;
if (!s->dev[port].res_fis ||
!(pr->cmd & PORT_CMD_FIS_RX)) {
return;
}
sdb_fis = (SDBFIS *)&a... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,296 | static void check_cmd(AHCIState *s, int port)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
int slot;
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
if ((pr->cmd_issue & (1U << slot)) &&
!handle_cmd(s, port, slot... | DoS | 0 | static void check_cmd(AHCIState *s, int port)
{
AHCIPortRegs *pr = &s->dev[port].port_regs;
int slot;
if ((pr->cmd & PORT_CMD_START) && pr->cmd_issue) {
for (slot = 0; (slot < 32) && pr->cmd_issue; slot++) {
if ((pr->cmd_issue & (1U << slot)) &&
!handle_cmd(s, port, slot... | @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,297 | static void debug_print_fis(uint8_t *fis, int cmd_len)
{
#ifdef DEBUG_AHCI
int i;
fprintf(stderr, "fis:");
for (i = 0; i < cmd_len; i++) {
if ((i & 0xf) == 0) {
fprintf(stderr, "\n%02x:",i);
}
fprintf(stderr, "%02x ",fis[i]);
}
fprintf(stderr, "\n");
#endif
}
| DoS | 0 | static void debug_print_fis(uint8_t *fis, int cmd_len)
{
#ifdef DEBUG_AHCI
int i;
fprintf(stderr, "fis:");
for (i = 0; i < cmd_len; i++) {
if ((i & 0xf) == 0) {
fprintf(stderr, "\n%02x:",i);
}
fprintf(stderr, "%02x ",fis[i]);
}
fprintf(stderr, "\n");
#endif
}
| @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,298 | static int prdt_tbl_entry_size(const AHCI_SG *tbl)
{
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
| DoS | 0 | static int prdt_tbl_entry_size(const AHCI_SG *tbl)
{
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
| @@ -730,7 +730,8 @@ static int prdt_tbl_entry_size(const AHCI_SG *tbl)
return (le32_to_cpu(tbl->flags_size) & AHCI_PRDT_SIZE_MASK) + 1;
}
-static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist, int offset)
+static int ahci_populate_sglist(AHCIDevice *ad, QEMUSGList *sglist,
+ ... | CWE-399 | null | null |
5,299 | static bool cmd_cfa_access_metadata_storage(IDEState *s, uint8_t cmd)
{
switch (s->feature) {
case 0x02: /* Inquiry Metadata Storage */
ide_cfata_metadata_inquiry(s);
break;
case 0x03: /* Read Metadata Storage */
ide_cfata_metadata_read(s);
break;
case 0x04: /* Write M... | DoS | 0 | static bool cmd_cfa_access_metadata_storage(IDEState *s, uint8_t cmd)
{
switch (s->feature) {
case 0x02: /* Inquiry Metadata Storage */
ide_cfata_metadata_inquiry(s);
break;
case 0x03: /* Read Metadata Storage */
ide_cfata_metadata_read(s);
break;
case 0x04: /* Write M... | @@ -731,10 +731,11 @@ void ide_dma_cb(void *opaque, int ret)
n = s->nsector;
s->io_buffer_index = 0;
s->io_buffer_size = n * 512;
- if (s->bus->dma->ops->prepare_buf(s->bus->dma, ide_cmd_is_read(s)) == 0) {
+ if (s->bus->dma->ops->prepare_buf(s->bus->dma, ide_cmd_is_read(s)) < 512) {
/* Th... | CWE-399 | null | null |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.