Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check number of args to ensure period_offsets is 0 #1175

Merged
merged 2 commits into from
Jul 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- Remove user from tags when deleting user [#1161](https://github.com/greenbone/gvmd/pull/1161)
- Handle INTERRUPTED scans [#1146](https://github.com/greenbone/gvmd/pull/1146)
- Check hosts in MODIFY_OVERRIDE, as in CREATE_OVERRIDE [#1162](https://github.com/greenbone/gvmd/pull/1162)
- Check number of args to ensure period_offsets is 0 [#1175](https://github.com/greenbone/gvmd/pull/1175)

### Removed
- Remove support for "All SecInfo": removal of "allinfo" for type in get_info [#790](https://github.com/greenbone/gvmd/pull/790)
Expand Down
7 changes: 5 additions & 2 deletions src/manage_pg_server.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ PG_FUNCTION_INFO_V1 (sql_next_time_ical);
/**
* @brief Get the next time given schedule times.
*
* This is a callback for a SQL function of four to six arguments.
* This is a callback for a SQL function of one to three arguments.
*
* @return Postgres Datum.
*/
Expand Down Expand Up @@ -168,7 +168,10 @@ sql_next_time_ical (PG_FUNCTION_ARGS)
zone = textndup (timezone_arg, VARSIZE (timezone_arg) - VARHDRSZ);
}

periods_offset = PG_GETARG_INT32 (2);
if (PG_NARGS() < 3)
periods_offset = 0;
else
periods_offset = PG_GETARG_INT32 (2);

ret = icalendar_next_time_from_string (ical_string, zone,
periods_offset);
Expand Down