Skip to content

Commit

Permalink
Fix CID 1393667 (Copy into fixed size buffer)
Browse files Browse the repository at this point in the history
Signed-off-by: Stefan Weil <sw@weilnetz.de>
  • Loading branch information
stweil committed Jun 30, 2018
1 parent 85794ca commit 1e1f35c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/opencl/openclwrapper.cpp
Expand Up @@ -29,6 +29,10 @@

#ifdef USE_OPENCL

#include <cstdio>
#include <vector>

#include "errcode.h" // for ASSERT_HOST
#include "opencl_device_selection.h"
GPUEnv OpenclDevice::gpuEnv;

Expand Down Expand Up @@ -758,14 +762,16 @@ int OpenclDevice::ReleaseOpenclRunEnv()
#endif
return 1;
}

inline int OpenclDevice::AddKernelConfig( int kCount, const char *kName )
{
if ( kCount < 1 )
fprintf(stderr,"Error: ( KCount < 1 ) AddKernelConfig\n" );
ASSERT_HOST(kCount > 0);
ASSERT_HOST(strlen(kName) < sizeof(gpuEnv.mArrykernelNames[kCount-1]));
strcpy( gpuEnv.mArrykernelNames[kCount-1], kName );
gpuEnv.mnKernelCount++;
return 0;
}

int OpenclDevice::RegistOpenclKernel()
{
if ( !gpuEnv.mnIsUserCreated )
Expand Down

0 comments on commit 1e1f35c

Please sign in to comment.