JavaScript is not currently enabled, but is required for full CodeSonar manual search and browse functionality.

If you are viewing this file in your hub's Web GUI, enable JavaScript in your browser: you will also need it for GUI functionality.

If you opened this file directly from disk, your browser may be directly suppressing JavaScript functionality: certain browsers perform this suppression on local files (but not files delivered by web servers) for security reasons.

CodeSonar® 9.2p0 CONFIDENTIAL CodeSecure Inc
C and C++


LANG.STRUCT.RFCESH : Return from Computational Exception Signal Handler

Summary

Control can return from a function used as a computational exception signal handler. Behavior is undefined when this occurs.

Properties

Class Name Return from Computational Exception Signal Handler
Significance security
Mnemonic LANG.STRUCT.RFCESH
Categories
CERT-C CERT-C:SIG35-C Do not return from a computational exception signal handler
Availability Available for C and C++.
Enabling Checks for this warning class are disabled by default. To enable them, add the following WARNING_FILTER rule to the project configuration file.
WARNING_FILTER += allow class="Return from Computational Exception Signal Handler"

Example

#include <signal.h>
#include <stdlib.h>

void handle_return(int s) {
    /* do error handling */
}

void handle_somereturn(int s) {
    /* do error handling */
    if (s < 5){
        exit(1);
    }
}

void handle_noreturn(int s) {
    /* do error handling */
    exit(1);
}

void lang_struct_rfcesh(void) {
    signal(SIGILL, handle_return);      /* 'Return from Computational Exception Signal Handler' warning issued here */
    signal(SIGILL, handle_somereturn);  /* 'Return from Computational Exception Signal Handler' warning issued here */
    signal(SIGILL, handle_noreturn);                        /* ok: control doesn't return from handle_noreturn() on any path */
}

Relevant Configuration File Parameters

The following configuration file parameters affect checks for this warning class.

 

To report problems with this documentation, please visit https://support.codesecure.com/.