diff options
author | Darryl L. Pierce <mcpierce@apache.org> | 2014-02-07 13:44:03 +0000 |
---|---|---|
committer | Darryl L. Pierce <mcpierce@apache.org> | 2014-02-07 13:44:03 +0000 |
commit | 6279d04292000261edb77be40678bd3cf5489481 (patch) | |
tree | 7e1f75f3fa549914a4151cefcc186c6dc105ecd2 | |
parent | ff10451274634cdd25765ba68cc4dd975a2b6015 (diff) | |
download | qpid-python-6279d04292000261edb77be40678bd3cf5489481.tar.gz |
QPID-5499: Fix Ruby/Perl bindings when built with -Werror=format-security
Changed the swig descriptors so that they use a constant format string.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1565651 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | qpid/cpp/bindings/qmf2/ruby/ruby.i | 2 | ||||
-rw-r--r-- | qpid/cpp/bindings/qpid/perl/perl.i | 2 | ||||
-rw-r--r-- | qpid/cpp/bindings/qpid/ruby/ruby.i | 42 | ||||
-rw-r--r-- | qpid/cpp/include/qpid/swig_perl_typemaps.i | 2 | ||||
-rw-r--r-- | qpid/cpp/include/qpid/swig_ruby_typemaps.i | 2 |
5 files changed, 25 insertions, 25 deletions
diff --git a/qpid/cpp/bindings/qmf2/ruby/ruby.i b/qpid/cpp/bindings/qmf2/ruby/ruby.i index 0254017555..65d0770224 100644 --- a/qpid/cpp/bindings/qmf2/ruby/ruby.i +++ b/qpid/cpp/bindings/qmf2/ruby/ruby.i @@ -30,7 +30,7 @@ } catch (qpid::types::Exception& mex) { static VALUE qmferror = rb_define_class("QmfError", rb_eStandardError); - rb_raise(qmferror, mex.what()); + rb_raise(qmferror, "%s", mex.what()); } } diff --git a/qpid/cpp/bindings/qpid/perl/perl.i b/qpid/cpp/bindings/qpid/perl/perl.i index 0d118ae0fb..4dc2665c2b 100644 --- a/qpid/cpp/bindings/qpid/perl/perl.i +++ b/qpid/cpp/bindings/qpid/perl/perl.i @@ -27,7 +27,7 @@ $action } catch (qpid::messaging::MessagingException& mex) { - Perl_croak(aTHX_ mex.what()); + Perl_croak(aTHX_ "%s", mex.what()); } } diff --git a/qpid/cpp/bindings/qpid/ruby/ruby.i b/qpid/cpp/bindings/qpid/ruby/ruby.i index 34388a2b16..a2f2ffab4c 100644 --- a/qpid/cpp/bindings/qpid/ruby/ruby.i +++ b/qpid/cpp/bindings/qpid/ruby/ruby.i @@ -34,86 +34,86 @@ } catch(qpid::messaging::ConnectionError& error) { static VALUE merror = rb_define_class("ConnectionError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::TransportFailure& error) { static VALUE merror = rb_define_class("TransportFailure", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::TransactionAborted& error) { static VALUE merror = rb_define_class("TransactionAborted", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::TransactionError& error) { static VALUE merror = rb_define_class("TransactionError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::UnauthorizedAccess& error) { static VALUE merror = rb_define_class("UnauthorizedAccess", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::SessionError& error) { static VALUE merror = rb_define_class("SessionError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::TargetCapacityExceeded& error) { static VALUE merror = rb_define_class("TargetCapacityExceeded", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::SendError& error) { static VALUE merror = rb_define_class("SendError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::SenderError& error) { static VALUE merror = rb_define_class("SenderError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::NoMessageAvailable& error) { static VALUE merror = rb_define_class("NoMessageAvailable", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::FetchError& error) { static VALUE merror = rb_define_class("FetchError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::ReceiverError& error) { static VALUE merror = rb_define_class("ReceiverError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::InvalidOptionString& error) { static VALUE merror = rb_define_class("InvalidOptionString", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::KeyError& error) { static VALUE merror = rb_define_class("KeyError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::AssertionFailed& error) { static VALUE merror = rb_define_class("AssertionFailed", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::NotFound& error) { static VALUE merror = rb_define_class("NotFound", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::ResolutionError& error) { static VALUE merror = rb_define_class("ResolutionError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::MalformedAddress& error) { static VALUE merror = rb_define_class("MalformedAddress", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::AddressError& error) { static VALUE merror = rb_define_class("AddressError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::LinkError& error) { static VALUE merror = rb_define_class("LinkError", eMessagingError); - rb_raise(merror, error.what()); + rb_raise(merror, "%s", error.what()); } catch(qpid::messaging::MessagingException& error) { - rb_raise(eMessagingError, error.what()); + rb_raise(eMessagingError, "%s", error.what()); } } diff --git a/qpid/cpp/include/qpid/swig_perl_typemaps.i b/qpid/cpp/include/qpid/swig_perl_typemaps.i index f1425ebd67..6c0e6d8bac 100644 --- a/qpid/cpp/include/qpid/swig_perl_typemaps.i +++ b/qpid/cpp/include/qpid/swig_perl_typemaps.i @@ -120,7 +120,7 @@ } } } catch (qpid::types::Exception& ex) { - Perl_croak(aTHX_ ex.what()); + Perl_croak(aTHX_ "%s", ex.what()); } if (!result) diff --git a/qpid/cpp/include/qpid/swig_ruby_typemaps.i b/qpid/cpp/include/qpid/swig_ruby_typemaps.i index 1a07cc86b0..4e07088bce 100644 --- a/qpid/cpp/include/qpid/swig_ruby_typemaps.i +++ b/qpid/cpp/include/qpid/swig_ruby_typemaps.i @@ -106,7 +106,7 @@ } } catch (qpid::types::Exception& ex) { static VALUE error = rb_define_class("Error", rb_eStandardError); - rb_raise(error, ex.what()); + rb_raise(error, "%s", ex.what()); } return result; |