Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
John P. Willis
freem
Commits
5e5169d2
Commit
5e5169d2
authored
Jun 02, 2022
by
John P. Willis
Browse files
Check for NULL subscripts in local variables and return ZSBSCR if any are found
parent
e76458c2
Pipeline
#747
passed with stage
in 1 minute and 27 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
1 deletion
+24
-1
src/mref.c
src/mref.c
+2
-1
src/symtab_dispatch.c
src/symtab_dispatch.c
+22
-0
No files found.
src/mref.c
View file @
5e5169d2
...
...
@@ -171,6 +171,7 @@ freem_ref_t *internal_to_mref (freem_ref_t *ref, char *key)
tmp
[
j
]
=
'\0'
;
mref_set_subscript
(
ref
,
i
++
,
tmp
);
ref
->
subscript_count
++
;
j
=
0
;
tmp
[
j
]
=
'\0'
;
...
...
@@ -189,7 +190,7 @@ freem_ref_t *internal_to_mref (freem_ref_t *ref, char *key)
/* grab the last one */
mref_set_subscript
(
ref
,
i
,
tmp
);
free
(
nam
);
free
(
tmp
);
...
...
src/symtab_dispatch.c
View file @
5e5169d2
...
...
@@ -38,8 +38,30 @@
**/
#include "mpsdef.h"
#include "mref.h"
void
symtab
(
short
action
,
char
*
key
,
char
*
data
)
{
register
int
i
;
freem_ref_t
*
r
=
(
freem_ref_t
*
)
malloc
(
sizeof
(
freem_ref_t
));
NULLPTRCHK
(
r
,
"symtab"
);
mref_init
(
r
,
MREF_RT_LOCAL
,
""
);
internal_to_mref
(
r
,
key
);
for
(
i
=
0
;
i
<
r
->
subscript_count
;
i
++
)
{
if
(
strlen
(
r
->
subscripts
[
i
])
<
1
)
{
ierr
=
SBSCR
;
free
(
r
);
return
;
}
}
symtab_bltin
(
action
,
key
,
data
);
free
(
r
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment