Skip to Main Content
IBM Power Ideas Portal


This portal is to open public enhancement requests against IBM Power Systems products, including IBM i. To view all of your ideas submitted to IBM, create and manage groups of Ideas, or create an idea explicitly set to be either visible by all (public) or visible only to you and IBM (private), use the IBM Unified Ideas Portal (https://ideas.ibm.com).


Shape the future of IBM!

We invite you to shape the future of IBM, including product roadmaps, by submitting ideas that matter to you the most. Here's how it works:

Search existing ideas

Start by searching and reviewing ideas and requests to enhance a product or service. Take a look at ideas others have posted, and add a comment, vote, or subscribe to updates on them if they matter to you. If you can't find what you are looking for,

Post your ideas
  1. Post an idea.

  2. Get feedback from the IBM team and other customers to refine your idea.

  3. Follow the idea through the IBM Ideas process.


Specific links you will want to bookmark for future use

Welcome to the IBM Ideas Portal (https://www.ibm.com/ideas) - Use this site to find out additional information and details about the IBM Ideas process and statuses.

IBM Unified Ideas Portal (https://ideas.ibm.com) - Use this site to view all of your ideas, create new ideas for any IBM product, or search for ideas across all of IBM.

ideasibm@us.ibm.com - Use this email to suggest enhancements to the Ideas process or request help from IBM for submitting your Ideas.

Status Submitted
Workspace IBM i
Categories Languages - Other
Created by Guest
Created on Jan 30, 2026

Security issue: C runtime functions snprintf and vsnprintf return code is very much non-standard.

This is useful because it allows C code to write functions securely and detect would-be buffer overruns that might result in security exposures. 

The return value for snprintf and vsnprintf are not consistent with C99 standard and most all other C runtime library implementations including IBM Z C standard library.

Many security exposures are due to 'buffer overruns'.   sprintf is a function that can be a major source of buffer overruns because only a pointer and no length is passed to the function, allowing it to write beyond the buffer's size.

snprintf attempts to overcome this problem by including the length.   In addition the C99 standard allows the caller to determine if a buffer overrun "would have" occurred and indicates that not all the data was written due to a short buffer.  It does this by returning the number of bytes that would have been written (not including null) rather than the number of bytes actually written (not including null)

C on IBM Z/os supports the proper return value semantics for snprintf. 
IBM ILE C states that the compiler supports a subset of the C99 standard and has an *ANSI option as well but nothing I've done can seem to get snprintf to return the number of bytes that would have been written.

The C run-time library does document the actual behavior, but it is very reasonable for a user calling a C standard library function to google the function name and nearly all results report that snprintf returns the number of bytes that 'would have' been written.

Please provide a C macro that can be defined that allows the modern standard implementation to be used rather than the long antiquated behavior we have now, so that we can write robust, secure code.   I'm assuming you don't want to change existing behavior so as not to break code, but you actually document that you may do that in one of your manuals as you make changes to meet standards. 

Idea priority Medium