- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The scan functions contain a bug that affects time zone routines, but could affect other routines as well. The bug is in both the PRO and STD versions of NIOS software versions 19 and above.
This bug does not appear to be in the publicly available versions of NEWLIB, just the Intel implementation.
The bug can be exposed with the following code:
char result[11];
int n;
sscanf ("ABC+XYZ", "%10[^+]%n", result, &n);
printf("Result string = '%s', Number of characters consumed = %d\n", &result, n);
The code above will return incorrect results:
Result string = 'ABC', Number of characters consumed = 6
The result string is correct but the number of characters consumed should be 3 not 6.
The file with the bug is vfscanf.c and it can be found in the following location which is dependent on the version of software installed:
C:\intelFPGA_pro\22.2\nios2eds\bin\gnu\src\newlib-4.1.0\newlib\libc\stdio\vfscanf.c
Around line 1196, this sequence of code can be found:
#ifdef _WANT_IO_POSIX_EXTENSIONS
shrink_m_ptr (char, p_p, n + 1, p_siz);
#endif
nassigned++;
nread += n;
}
nread += n; <<<<==== REMOVE THIS LINE
break;
case CT_STRING:
/* like CCL, but zero-length string OK, & no NOSKIP */
if (width == 0)
width = SIZE_MAX;
The line indicated in the code fragment should be removed. After editing the vscanf.c file, you will need to rebuild the library which can be done by cleaning the BSP project then building it again.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thank you for notifying us the issue. We will look into it and get back to you.
Thank you.
Regards,
Kelly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
We are currently still looking into the issue that you have raised.
Thank you.
Regards,
Kelly Jialin, GOH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Is it possible we close this case first while the engineering team continue with their investigation?
Regards,
Kelly Jialin, GOH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Any updates on your side?
Regards,
Kelly
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
As we do not receive any response from you on the previous reply that we have provided. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
p/s: If any answer from the community or Intel Support are helpful, please feel free to give best answer or rate 9/10 survey.
Thank you.
Regards,
Kelly Jialin. GOH
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I don't understand why you would want to close this issue when it hasn't been addressed by Intel. Transitioning it to community support will not help since the community does not provide the library to itself. Since Intel distributes the library, only Intel can fix it for everyone. For myself, I already patched the libraries but that doesn't help everyone else.
If you feel you must close this case, go ahead.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page