code stringlengths 12 2.05k | label_name stringlengths 6 8 | label int64 0 95 |
|---|---|---|
func (*DeleteWalletLedgerRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{22}
} | CWE-613 | 7 |
func (*DeleteFriendRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{16}
} | CWE-613 | 7 |
func (x *StatusList_Status) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[49]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (*RuntimeInfo_ModuleInfo) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{41, 0}
} | CWE-613 | 7 |
func Render(tmpl string, s *types.Step) (types.StepSlice, error) {
buffer := new(bytes.Buffer)
config := new(types.Build)
velaFuncs := funcHandler{envs: convertPlatformVars(s.Environment)}
templateFuncMap := map[string]interface{}{
"vela": velaFuncs.returnPlatformVar,
}
// parse the template with Masterminds/... | CWE-78 | 6 |
func (hs *HTTPServer) pluginMarkdown(ctx context.Context, pluginId string, name string) ([]byte, error) {
plugin, exists := hs.pluginStore.Plugin(ctx, pluginId)
if !exists {
return nil, plugins.NotFoundError{PluginID: pluginId}
}
// nolint:gosec
// We can ignore the gosec G304 warning on this one because `plugi... | CWE-22 | 2 |
func checkAuth(ctx context.Context, config Config, auth string) (context.Context, bool) {
const basicPrefix = "Basic "
const bearerPrefix = "Bearer "
if strings.HasPrefix(auth, basicPrefix) {
// Basic authentication.
username, password, ok := parseBasicAuth(auth)
if !ok {
return ctx, false
}
if userna... | CWE-613 | 7 |
func (x *DeleteGroupUserRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[18]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (s *SMTP) GetDialer() (mailer.Dialer, error) {
// Setup the message and dial
hp := strings.Split(s.Host, ":")
if len(hp) < 2 {
hp = append(hp, "25")
}
host := hp[0]
// Any issues should have been caught in validation, but we'll
// double check here.
port, err := strconv.Atoi(hp[1])
if err != nil {
log... | CWE-918 | 16 |
func (err ErrInvalidCloneAddr) Error() string {
return fmt.Sprintf("invalid clone address [is_url_error: %v, is_invalid_path: %v, is_permission_denied: %v]",
err.IsURLError, err.IsInvalidPath, err.IsPermissionDenied)
} | CWE-918 | 16 |
func (p *CompactProtocol) ReadBinary() (value []byte, err error) {
length, e := p.readVarint32()
if e != nil {
return nil, NewProtocolException(e)
}
if length == 0 {
return []byte{}, nil
}
if length < 0 {
return nil, invalidDataLength
}
if uint64(length) > p.trans.RemainingBytes() {
return nil, invalidD... | CWE-770 | 37 |
func (x *ListGroupsRequest) Reset() {
*x = ListGroupsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[27]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func main() {
hostPtr := flag.String("host", "localhost:9159", "the hostname that the server should listen on.")
tokenPtr := flag.String("token", "", "the Proxy Access Token used to restrict access to the server.")
allowedOriginsPtr := flag.String("allowed-origins", "*", "a comma separated list of allowed origins.")... | CWE-918 | 16 |
func (p *HTTPClient) Read(buf []byte) (int, error) {
if p.response == nil {
return 0, NewTransportException(NOT_OPEN, "Response buffer is empty, no request.")
}
n, err := p.response.Body.Read(buf)
if n > 0 && (err == nil || err == io.EOF) {
return n, nil
}
return n, NewTransportExceptionFromError(err)
} | CWE-770 | 37 |
func (*ListStorageRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{30}
} | CWE-613 | 7 |
func (x *Leaderboard) Reset() {
*x = Leaderboard{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[23]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (s *Server) CheckDeletionToken(deletionToken, token, filename string) error {
s.Lock(token, filename)
defer s.Unlock(token, filename)
var metadata Metadata
r, _, err := s.storage.Get(token, fmt.Sprintf("%s.metadata", filename))
if s.storage.IsNotExist(err) {
return nil
} else if err != nil {
return err... | CWE-79 | 1 |
func isMatchingRedirectURI(uri string, haystack []string) bool {
requested, err := url.Parse(uri)
if err != nil {
return false
}
for _, b := range haystack {
if strings.ToLower(b) == strings.ToLower(uri) || isLoopbackURI(requested, b) {
return true
}
}
return false
} | CWE-178 | 40 |
func TestUnsafeAllowPrivateRanges (t *testing.T) {
a := assert.New(t)
conf := NewConfig()
a.NoError(conf.SetDenyRanges([]string {"192.168.0.0/24", "10.0.0.0/8"}))
conf.ConnectTimeout = 10 * time.Second
conf.ExitTimeout = 10 * time.Second
conf.AdditionalErrorMessageOnDeny = "Proxy denied"
conf.UnsafeAllowPrivat... | CWE-918 | 16 |
func TestClean(t *testing.T) {
tests := []struct {
path string
expVal string
}{
{
path: "../../../readme.txt",
expVal: "readme.txt",
},
{
path: "a/../../../readme.txt",
expVal: "readme.txt",
},
{
path: "/../a/b/../c/../readme.txt",
expVal: "a/readme.txt",
},
{
path: "/... | CWE-22 | 2 |
func createDefaultConfigFileIfNotExists() error {
defaultFilePath := GetDefaultConfigFilePath()
if isExists(defaultFilePath) {
return nil
}
folderPath := filepath.Dir(defaultFilePath)
if !isExists(folderPath) {
err := os.Mkdir(folderPath, folderPermission)
if err != nil {
return err
}
}
f, err := os.C... | CWE-276 | 45 |
func IsLocalHostname(hostname string, allowlist []string) bool {
for _, allow := range allowlist {
if hostname == allow {
return false
}
}
ips, err := net.LookupIP(hostname)
if err != nil {
return true
}
for _, ip := range ips {
for _, cidr := range localCIDRs {
if cidr.Contains(ip) {
return tr... | CWE-918 | 16 |
func (*Username) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{38}
} | CWE-613 | 7 |
func (p *CompactProtocol) ReadFieldBegin() (name string, typeId Type, id int16, err error) {
t, err := p.readByteDirect()
if err != nil {
return
}
// if it's a stop, then we can return immediately, as the struct is over.
if (t & 0x0f) == STOP {
return "", STOP, 0, nil
}
// mask off the 4 MSB of the type he... | CWE-770 | 37 |
func ServeData(ctx *context.Context, name string, size int64, reader io.Reader) error {
buf := make([]byte, 1024)
n, err := util.ReadAtMost(reader, buf)
if err != nil {
return err
}
if n >= 0 {
buf = buf[:n]
}
ctx.Resp.Header().Set("Cache-Control", "public,max-age=86400")
if size >= 0 {
ctx.Resp.Header(... | CWE-79 | 1 |
func handleConnect(config *Config, pctx *goproxy.ProxyCtx) error {
sctx := pctx.UserData.(*smokescreenContext)
// Check if requesting role is allowed to talk to remote
sctx.decision, sctx.lookupTime, pctx.Error = checkIfRequestShouldBeProxied(config, pctx.Req, pctx.Req.Host)
if pctx.Error != nil {
return pctx.Er... | CWE-918 | 16 |
func (p *Profile) writeConfWgQuick(data *WgConf) (pth string, err error) {
allowedIps := []string{}
if data.Routes != nil {
for _, route := range data.Routes {
allowedIps = append(allowedIps, route.Network)
}
}
if data.Routes6 != nil {
for _, route := range data.Routes6 {
allowedIps = append(allowedIps,... | CWE-59 | 36 |
func (*CallApiEndpointRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{12}
} | CWE-613 | 7 |
func WriteCode(id string, code string) {
memory.Code[id] = code
} | CWE-305 | 92 |
func (x *DeleteFriendRequest) Reset() {
*x = DeleteFriendRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[16]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (p *BinaryProtocol) ReadBinary() ([]byte, error) {
size, e := p.ReadI32()
if e != nil {
return nil, e
}
if size < 0 {
return nil, invalidDataLength
}
if uint64(size) > p.trans.RemainingBytes() {
return nil, invalidDataLength
}
isize := int(size)
buf := make([]byte, isize)
_, err := io.ReadFull(p.t... | CWE-770 | 37 |
func (*DeleteStorageObjectRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{21}
} | CWE-613 | 7 |
func (*Config_Warning) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{14, 0}
} | CWE-613 | 7 |
func (*DeleteGroupUserRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{18}
} | CWE-613 | 7 |
func checkVersion() {
// Templates.
data, err := ioutil.ReadFile(path.Join(setting.StaticRootPath, "templates/.VERSION"))
if err != nil {
log.Fatal(4, "Fail to read 'templates/.VERSION': %v", err)
}
if string(data) != setting.AppVer {
log.Fatal(4, "Binary and template file version does not match, did you forge... | CWE-89 | 0 |
func (x *ListAccountsRequest) Reset() {
*x = ListAccountsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[26]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (p *HTTPClient) RemainingBytes() (num_bytes uint64) {
len := p.response.ContentLength
if len >= 0 {
return uint64(len)
}
return UnknownRemaining // the truth is, we just don't know unless framed is used
} | CWE-770 | 37 |
func (x *StorageList) Reset() {
*x = StorageList{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *WalletLedgerList) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[43]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (*ListGroupsRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{27}
} | CWE-613 | 7 |
func TestReadMIMEHeaderNonCompliant(t *testing.T) {
// Invalid HTTP response header as sent by an Axis security
// camera: (this is handled by IE, Firefox, Chrome, curl, etc.)
r := reader("Foo: bar\r\n" +
"Content-Language: en\r\n" +
"SID : 0\r\n" +
"Audio Mode : None\r\n" +
"Privilege : 127\r\n\r\n")
m, er... | CWE-444 | 41 |
func TestInvalidPaddingOpen(t *testing.T) {
key := make([]byte, 32)
nonce := make([]byte, 16)
// Plaintext with invalid padding
plaintext := padBuffer(make([]byte, 28), aes.BlockSize)
plaintext[len(plaintext)-1] = 0xFF
io.ReadFull(rand.Reader, key)
io.ReadFull(rand.Reader, nonce)
block, _ := aes.NewCipher(ke... | CWE-190 | 19 |
func (*WalletLedgerList) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{43}
} | CWE-613 | 7 |
func fixTransferEncoding(requestMethod string, header Header) ([]string, error) {
raw, present := header["Transfer-Encoding"]
if !present {
return nil, nil
}
delete(header, "Transfer-Encoding")
encodings := strings.Split(raw[0], ",")
te := make([]string, 0, len(encodings))
// TODO: Even though we only suppor... | CWE-444 | 41 |
func (x *StatusList) Reset() {
*x = StatusList{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[40]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *ListStorageRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[30]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (s *ConsoleServer) lookupConsoleUser(ctx context.Context, unameOrEmail, password string) (id uuid.UUID, uname string, email string, role console.UserRole, err error) {
role = console.UserRole_USER_ROLE_UNKNOWN
query := "SELECT id, username, email, role, password, disable_time FROM console_user WHERE username = $... | CWE-307 | 26 |
func GetCode(id string) string {
return memory.Code[id]
} | CWE-305 | 92 |
func ReadWriteProtocolTest(t *testing.T, protocolFactory ProtocolFactory) {
buf := bytes.NewBuffer(make([]byte, 0, 1024))
l := HTTPClientSetupForTest(t)
defer l.Close()
transports := []TransportFactory{
NewMemoryBufferTransportFactory(1024),
NewStreamTransportFactory(buf, buf, true),
NewFramedTransportFactory... | CWE-770 | 37 |
s := strings.Map(func(c rune) rune {
switch c {
case ' ', '\t', '\n', '\f', '\r':
return c
}
return -1
}, p.tok.Data)
if s != "" {
p.addText(s)
}
case StartTagToken:
switch p.tok.DataAtom {
case a.Html:
return inBodyIM(p)
case a.Frameset:
p.addElement()
case a.Frame:
p.addEl... | CWE-476 | 46 |
func (x *Leaderboard) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[23]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (x *CallApiEndpointResponse) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[13]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func TestNewOAuth2ResourceServer(t *testing.T) {
newMockResourceServer(t)
} | CWE-613 | 7 |
func (x *DeleteGroupRequest) Reset() {
*x = DeleteGroupRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[17]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (rarFormat) Read(input io.Reader, destination string) error {
rr, err := rardecode.NewReader(input, "")
if err != nil {
return fmt.Errorf("read: failed to create reader: %v", err)
}
for {
header, err := rr.Next()
if err == io.EOF {
break
} else if err != nil {
return err
}
if header.IsDir {... | CWE-22 | 2 |
func isLoopbackURI(requested *url.URL, registeredURI string) bool {
registered, err := url.Parse(registeredURI)
if err != nil {
return false
}
if registered.Scheme != "http" || !isLoopbackAddress(registered.Host) {
return false
}
if requested.Scheme == "http" && isLoopbackAddress(requested.Host) && register... | CWE-601 | 11 |
func (x *DeleteGroupUserRequest) Reset() {
*x = DeleteGroupUserRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[18]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (*UpdateGroupRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{37}
} | CWE-613 | 7 |
func resize(in []byte, n int) (head, tail []byte) {
if cap(in) >= n {
head = in[:n]
} else {
head = make([]byte, n)
copy(head, in)
}
tail = head[len(in):]
return
} | CWE-190 | 19 |
func (x *StatusList) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[40]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (x *DeleteWalletLedgerRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[22]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (x *DeleteLeaderboardRecordRequest) Reset() {
*x = DeleteLeaderboardRecordRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[20]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func newContainerInit(t initType, pipe *os.File, consoleSocket *os.File, fifoFd, logFd int) (initer, error) {
var config *initConfig
if err := json.NewDecoder(pipe).Decode(&config); err != nil {
return nil, err
}
if err := populateProcessEnvironment(config.Env); err != nil {
return nil, err
}
switch t {
case... | CWE-190 | 19 |
func parseConsoleToken(hmacSecretByte []byte, tokenString string) (username, email string, role console.UserRole, exp int64, ok bool) {
token, err := jwt.ParseWithClaims(tokenString, &ConsoleTokenClaims{}, func(token *jwt.Token) (interface{}, error) {
if s, ok := token.Method.(*jwt.SigningMethodHMAC); !ok || s.Hash ... | CWE-613 | 7 |
func (x *StorageList) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[33]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (x *ListAccountsRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[26]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (*LeaderboardList) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{24}
} | CWE-613 | 7 |
func (x *WalletLedgerList) Reset() {
*x = WalletLedgerList{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[43]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *LeaderboardRequest) Reset() {
*x = LeaderboardRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[25]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func doTmpfsCopyUp(m *configs.Mount, rootfs, mountLabel string) (Err error) {
// Set up a scratch dir for the tmpfs on the host.
tmpdir, err := prepareTmp("/tmp")
if err != nil {
return fmt.Errorf("tmpcopyup: failed to setup tmpdir: %w", err)
}
defer cleanupTmp(tmpdir)
tmpDir, err := ioutil.TempDir(tmpdir, "run... | CWE-190 | 19 |
func cmdGet(args *docopt.Args, client *tuf.Client) error {
if _, err := client.Update(); err != nil && !tuf.IsLatestSnapshot(err) {
return err
}
target := util.NormalizeTarget(args.String["<target>"])
file, err := ioutil.TempFile("", "go-tuf")
if err != nil {
return err
}
tmp := tmpFile{file}
if err := clie... | CWE-354 | 82 |
func (x *Username) Reset() {
*x = Username{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[38]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func TestGetDynamic(t *testing.T) {
savedServices := services
savedGetVCSDirFn := getVCSDirFn
defer func() {
services = savedServices
getVCSDirFn = savedGetVCSDirFn
}()
services = []*service{{pattern: regexp.MustCompile(".*"), get: testGet}}
getVCSDirFn = testGet
client := &http.Client{Transport: testTranspo... | CWE-22 | 2 |
func (x *Config_Warning) Reset() {
*x = Config_Warning{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[46]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *MatchStateRequest) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[32]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (x *RuntimeInfo_ModuleInfo) Reset() {
*x = RuntimeInfo_ModuleInfo{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[50]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *ConsoleSession) Reset() {
*x = ConsoleSession{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[15]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *Config) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[14]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (o *casaService) GetServerAppInfo(id, t string) model.ServerAppList {
head := make(map[string]string)
head["Authorization"] = GetToken()
infoS := httper2.Get(config.ServerInfo.ServerApi+"/v2/app/info/"+id+"?t="+t, head)
info := model.ServerAppList{}
json2.Unmarshal([]byte(gjson.Get(infoS, "data").String())... | CWE-78 | 6 |
func (*RuntimeInfo) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{41}
} | CWE-613 | 7 |
func fixLength(isResponse bool, status int, requestMethod string, header Header, te []string) (int64, error) {
// Logic based on response type or status
if noBodyExpected(requestMethod) {
return 0, nil
}
if status/100 == 1 {
return 0, nil
}
switch status {
case 204, 304:
return 0, nil
}
// Logic based ... | CWE-444 | 41 |
func SearchRepositoryByName(opt SearchOption) (repos []*Repository, err error) {
// Prevent SQL inject.
opt.Keyword = strings.TrimSpace(opt.Keyword)
if len(opt.Keyword) == 0 {
return repos, nil
}
opt.Keyword = strings.Split(opt.Keyword, " ")[0]
if len(opt.Keyword) == 0 {
return repos, nil
}
opt.Keyword = s... | CWE-89 | 0 |
func (x *Username) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[38]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (*Provider) Render(ctx *provider.Context, config, data string) string {
result := blackfriday.Run([]byte(data))
return string(result)
} | CWE-79 | 1 |
func (c Criteria) OrderBy() string {
if c.Sort == "" {
c.Sort = "title"
}
f := fieldMap[strings.ToLower(c.Sort)]
var mapped string
if f == nil {
log.Error("Invalid field in 'sort' field", "field", c.Sort)
mapped = c.Sort
} else {
if f.order == "" {
mapped = f.field
} else {
mapped = f.order
}
}... | CWE-89 | 0 |
func (*Config) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{14}
} | CWE-613 | 7 |
func SettingsEmailPost(c *context.Context, f form.AddEmail) {
c.Title("settings.emails")
c.PageIs("SettingsEmails")
// Make emailaddress primary.
if c.Query("_method") == "PRIMARY" {
if err := db.MakeEmailPrimary(&db.EmailAddress{ID: c.QueryInt64("id")}); err != nil {
c.ServerError("MakeEmailPrimary", err)
... | CWE-281 | 93 |
func (*UpdateGroupUserStateRequest) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{19}
} | CWE-613 | 7 |
func (x *ListSubscriptionsRequest) Reset() {
*x = ListSubscriptionsRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *ListPurchasesRequest) Reset() {
*x = ListPurchasesRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[28]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (x *UnlinkDeviceRequest) Reset() {
*x = UnlinkDeviceRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[35]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func MigratePost(c *context.Context, f form.MigrateRepo) {
c.Data["Title"] = c.Tr("new_migrate")
ctxUser := checkContextUser(c, f.Uid)
if c.Written() {
return
}
c.Data["ContextUser"] = ctxUser
if c.HasError() {
c.Success(MIGRATE)
return
}
remoteAddr, err := f.ParseRemoteAddr(c.User)
if err != nil {
... | CWE-918 | 16 |
func (*StorageList) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{33}
} | CWE-613 | 7 |
func (x *UpdateGroupRequest) Reset() {
*x = UpdateGroupRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[37]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func (*StatusList) Descriptor() ([]byte, []int) {
return file_console_proto_rawDescGZIP(), []int{40}
} | CWE-613 | 7 |
func (x *RuntimeInfo_ModuleInfo) ProtoReflect() protoreflect.Message {
mi := &file_console_proto_msgTypes[50]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
} | CWE-613 | 7 |
func (p *OAuthProxy) IsValidRedirect(redirect string) bool {
switch {
case redirect == "":
// The user didn't specify a redirect, should fallback to `/`
return false
case strings.HasPrefix(redirect, "/") && !strings.HasPrefix(redirect, "//") && !invalidRedirectRegex.MatchString(redirect):
return true
case str... | CWE-601 | 11 |
func (x *DeleteStorageObjectRequest) Reset() {
*x = DeleteStorageObjectRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_console_proto_msgTypes[21]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
} | CWE-613 | 7 |
func UnpackTar(filename string, destination string, verbosityLevel int) (err error) {
Verbose = verbosityLevel
f, err := os.Stat(destination)
if os.IsNotExist(err) {
return fmt.Errorf("destination directory '%s' does not exist", destination)
}
filemode := f.Mode()
if !filemode.IsDir() {
return fmt.Errorf("des... | CWE-59 | 36 |
func (ctx *cbcAEAD) Seal(dst, nonce, plaintext, data []byte) []byte {
// Output buffer -- must take care not to mangle plaintext input.
ciphertext := make([]byte, len(plaintext)+ctx.Overhead())[:len(plaintext)]
copy(ciphertext, plaintext)
ciphertext = padBuffer(ciphertext, ctx.blockCipher.BlockSize())
cbc := ciph... | CWE-190 | 19 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.