Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1753086

Summary: swig octave bindings generate format security errors
Product: Red Hat Enterprise Linux 8 Reporter: Orion Poplawski <orion>
Component: swigAssignee: Jitka Plesnikova <jplesnik>
Status: CLOSED DUPLICATE QA Contact: RHEL CS Apps Subsystem QE <rhel-cs-apps-subsystem-qe>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 8.0Keywords: Patch, Triaged
Target Milestone: rcFlags: pm-rhel: mirror+
Target Release: 8.0   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-09-14 09:03:40 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Fix format-security error with octave 5.1 none

Description Orion Poplawski 2019-09-18 04:18:05 UTC
Description of problem:

Trying to build plplot for EPEL8 I get:

BUILDSTDERR: /builddir/build/BUILD/plplot-5.14.0/fedora/bindings/octave/plplot_octaveOCTAVE_wrap.cxx:921:18: error: format not a string literal and no format arguments [-Werror=format-security]
BUILDSTDERR:    error(r.c_str());
BUILDSTDERR:                   ^

This is fixed upstream with:

commit c38b7de6a120e6392abff50afd9bb919cc858cfc
Author: Orion Poplawski <orion>
Date:   Sun Mar 10 11:47:27 2019 -0600

    Fix format-security error with octave 5.1

diff --git a/Lib/octave/octrun.swg b/Lib/octave/octrun.swg
index 3012331..ff614e6 100644
--- a/Lib/octave/octrun.swg
+++ b/Lib/octave/octrun.swg
@@ -51,7 +51,7 @@ SWIGRUNTIME octave_value SWIG_Error(int code, const char *msg) {
   octave_value type(SWIG_ErrorType(code));
   std::string r = msg;
   r += " (" + type.string_value() + ")";
-  error(r.c_str());
+  error("%s", r.c_str());
   return octave_value(r);
 }

@@ -840,7 +840,7 @@ SWIGRUNTIME void swig_acquire_ownership_obj(void *vptr, int own);
       const std::string opname = std::string("__") + octave_base_value::get_umap_name(umap) + std::string("__");
       octave_value ret;
       if (!dispatch_unary_op(opname, ret)) {
-        error((opname + std::string(" method not found")).c_str());
+        error("%s", (opname + std::string(" method not found")).c_str());
         return octave_value();
       }
       return ret;

Version-Release number of selected component (if applicable):
3.0.12-18.module+el8+2480+72897362

Comment 1 Jitka Plesnikova 2019-09-18 07:24:17 UTC
Created attachment 1616111 [details]
Fix format-security error with octave 5.1

Comment 2 Orion Poplawski 2019-09-19 03:50:24 UTC
Thanks for addressing this so quickly.

Comment 3 Jitka Plesnikova 2019-10-03 13:44:10 UTC
Thank you for the report. 

Please contact Red Hat support that helps you escalate this issue.

Comment 4 Jitka Plesnikova 2020-09-14 09:03:40 UTC
The support of new octave will be added by module swig:4.0.

*** This bug has been marked as a duplicate of bug 1853639 ***