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

Incorrect output like 'reported error function toString() { [native code] }' #283

Closed
mcm1957 opened this issue Jul 2, 2023 · 1 comment

Comments

@mcm1957
Copy link
Member

mcm1957 commented Jul 2, 2023

toString is missing () at several code places resulting in off behavior.

i.e.

        case snmp.ObjectType.OctetString: {
            switch (pFormat) {
                case F_TEXT /* 0 */:
                case F_AUTO /* 99 */:
                default:
                    retval.val = pVarbind.value.toString();
                    retval.format = F_TEXT;
                    break;
                case F_NUMERIC /* 1 */: {
                    const valint = parseInt(pVarbind.value.toString, 10);
                    retval.val = valint;
                    if (isNaN (valint)) retval.qual=0x01; // general error
                    break;
                }
                case F_BOOLEAN /* 2 */: {
                    const valint = parseInt(pVarbind.value.toString, 10);
                    retval.val = valint !== 0;
                    if (isNaN (valint)) retval.qual=0x01; // general error
                    break;
@mcm1957 mcm1957 added the bug label Jul 2, 2023
@mcm1957 mcm1957 self-assigned this Jul 2, 2023
@mcm1957 mcm1957 added next release planned for next release PRIORITY labels Jul 2, 2023
@mcm1957 mcm1957 added this to the Release 2.4.x fixes milestone Jul 2, 2023
mcm1957 added a commit that referenced this issue Jul 4, 2023
* (McM1957) fixed: UDP ports got lost during error handling (#282)
* (McM1957) fixed: Incorrect toString() syntax caused several issues, i.e. missing error output (#283)
* (McM1957) Dependencies have been updated
@mcm1957 mcm1957 added fixed and removed next release planned for next release labels Jul 4, 2023
@mcm1957
Copy link
Member Author

mcm1957 commented Jul 4, 2023

fixed with 2.4.8

@mcm1957 mcm1957 closed this as completed Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant