mirror of
https://github.com/tbamud/tbamud.git
synced 2026-04-30 04:41:51 +02:00
Fix for code scanning alert no. 74: Potential use after free (#164)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
This commit is contained in:
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -3,7 +3,7 @@ name: C/C++ CI
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
pull_request:
|
pull_request_target:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
|
|||||||
2
.github/workflows/codeql.yml
vendored
2
.github/workflows/codeql.yml
vendored
@@ -14,8 +14,6 @@ name: "CodeQL Advanced"
|
|||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ "master" ]
|
branches: [ "master" ]
|
||||||
pull_request:
|
|
||||||
branches: [ "master" ]
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '42 10 * * 4'
|
- cron: '42 10 * * 4'
|
||||||
|
|
||||||
|
|||||||
@@ -147,7 +147,7 @@ void greet_memory_mtrigger(char_data *actor)
|
|||||||
{
|
{
|
||||||
trig_data *t;
|
trig_data *t;
|
||||||
char_data *ch;
|
char_data *ch;
|
||||||
struct script_memory *mem;
|
struct script_memory *mem, *next_mem;
|
||||||
char buf[MAX_INPUT_LENGTH];
|
char buf[MAX_INPUT_LENGTH];
|
||||||
int command_performed = 0;
|
int command_performed = 0;
|
||||||
|
|
||||||
@@ -159,7 +159,8 @@ void greet_memory_mtrigger(char_data *actor)
|
|||||||
AFF_FLAGGED(ch, AFF_CHARM))
|
AFF_FLAGGED(ch, AFF_CHARM))
|
||||||
continue;
|
continue;
|
||||||
/* find memory line with command only */
|
/* find memory line with command only */
|
||||||
for (mem = SCRIPT_MEM(ch); mem && SCRIPT_MEM(ch); mem=mem->next) {
|
for (mem = SCRIPT_MEM(ch); mem && SCRIPT_MEM(ch); mem = next_mem) {
|
||||||
|
next_mem = mem->next;
|
||||||
if (char_script_id(actor)!=mem->id) continue;
|
if (char_script_id(actor)!=mem->id) continue;
|
||||||
if (mem->cmd) {
|
if (mem->cmd) {
|
||||||
command_interpreter(ch, mem->cmd); /* no script */
|
command_interpreter(ch, mem->cmd); /* no script */
|
||||||
|
|||||||
Reference in New Issue
Block a user