Bug 53940
Summary: | scanf(3) doesn't seem to handle %n properly | ||||||
---|---|---|---|---|---|---|---|
Product: | [Retired] Red Hat Linux | Reporter: | Stas Sergeev <stssppnn> | ||||
Component: | glibc | Assignee: | Jakub Jelinek <jakub> | ||||
Status: | CLOSED NOTABUG | QA Contact: | Aaron Brown <abrown> | ||||
Severity: | low | Docs Contact: | |||||
Priority: | medium | ||||||
Version: | 7.1 | CC: | fweimer | ||||
Target Milestone: | --- | ||||||
Target Release: | --- | ||||||
Hardware: | i386 | ||||||
OS: | Linux | ||||||
Whiteboard: | |||||||
Fixed In Version: | Doc Type: | Bug Fix | |||||
Doc Text: | Story Points: | --- | |||||
Clone Of: | Environment: | ||||||
Last Closed: | 2001-09-23 11:12:44 UTC | Type: | --- | ||||
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
Stas Sergeev
2001-09-23 11:10:25 UTC
Created attachment 32418 [details]
simple test program for scanf()
It is a bug, but not in glibc, but in the program you have. In first sscanf, you get matching failure already before the %n directive, so it is not assigned. See e.g. ISO C99, or http://www.opengroup.org/onlinepubs/007908799/xsh/fscanf.html You really have to check *scanf return value first before assuming which arguments were assigned to. |