Skip to content

Commit

Permalink
fix some issues found by CodeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
Neverous committed Jul 29, 2023
1 parent 721f0b6 commit 48ea88c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
3 changes: 1 addition & 2 deletions include/efiboot.h
Original file line number Diff line number Diff line change
Expand Up @@ -610,8 +610,7 @@ inline std::optional<Load_option> deserialize(const void *data, size_t data_size

uint8_t *optional_data = nullptr;
size_t optional_data_size = 0;
int ret = efi_loadopt_optional_data(load_option, data_size, &optional_data, &optional_data_size);
if(ret >= 0)
if(int ret = efi_loadopt_optional_data(load_option, data_size, &optional_data, &optional_data_size); ret >= 0)
{
auto opt_data = deserialize<Raw_data>(optional_data, optional_data_size);
if(!opt_data)
Expand Down
2 changes: 2 additions & 0 deletions include/efibooteditorcli.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once

#include <QCommandLineParser>
#include <QCoreApplication>

Expand Down
4 changes: 2 additions & 2 deletions include/efivar-lite/efivar.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
typedef struct ATTR_ALIGN(1)
{
#if defined(_WIN32)
TCHAR data[39];
const TCHAR *data;
#elif defined(__APPLE__)
char data[37];
const char *data;
#else
uint32_t a;
uint16_t b;
Expand Down
2 changes: 2 additions & 0 deletions src/efivar-lite.common.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
// SPDX-License-Identifier: LGPL-3.0-or-later
#pragma once

#include <stdarg.h>
#include <stdint.h>
#include <string.h>
Expand Down

0 comments on commit 48ea88c

Please sign in to comment.