Opened 3 years ago

Closed 3 years ago

#802 closed defect (fixed)

Omegascript setrelevant should set minargs to be 1 instead of 0

Reported by: Gaurav Arora Owned by: Olly Betts
Priority: normal Milestone: 1.4.16
Component: Omega Version: git master
Severity: normal Keywords:
Cc: Blocked By:
Blocking: Operating System: All

Description (last modified by Gaurav Arora)

setrelevant set the minargs to be 0

T(setrelevant,	   0, 1, N, Q), // set rset

But assumes it has one argument

	    case CMD_setrelevant: {
		string::size_type i = 0, j;
		while (true) {
		    j = args[0].find_first_not_of("0123456789", i);

It gets a segmentation fault when we add $setrelevant to the template instead of throwing an error message about min-argument.

Its an easy fix so probably can be directly done in repo instead of the pull request. Happy to open a pull request if it would be helpful.

Change History (3)

comment:1 by Gaurav Arora, 3 years ago

Description: modified (diff)

comment:2 by Olly Betts, 3 years ago

Component: OtherOmega
Milestone: 1.4.16
Status: newassigned
Version: git master

Fixed on git master with a regression test by 98ccd785be01bb5c7c54807ed0ad117ff63907ef. This seems to also affect 1.4.x (from the code - not tested as such).

comment:3 by Olly Betts, 3 years ago

Resolution: fixed
Status: assignedclosed

Backported on 2020-01-04 as f6e81d52d9ce4cc09077195a3fb96f3f642792e1.

Note: See TracTickets for help on using tickets.