Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the bug of sscanf exception output in arm64 platform #11182

Merged
merged 1 commit into from Nov 15, 2023

Conversation

Boatingup
Copy link

@Boatingup Boatingup commented Nov 14, 2023

Summary

On the arm64 platform, size_t needs to be set to the corresponding mode in sscanf, otherwise the format will be converted incorrectly

Impact

Testing

  char header[5];
  size_t size;
  header[0] = '0';
  header[1] = '0';
  header[2] = '2';
  header[3] = '1';
  header[4] = 0;
  fprintf(stderr, "header = \"%s\"\n", header);
  if (sscanf(header, "%04zx", &size) != 1)
    {   
      return -EINVAL;
    } 
  fprintf(stderr, "size = %04zx\n", size); 

Unmodified test results

header = "0021"
size = deaddead00000021

Modified test results

header = "0021"                                                                                                                            
size = 0021                                                                                                                                                                                                                                             

Signed-off-by: fengxuesong <fengxuesong@xiaomi.com>
@xiaoxiang781216 xiaoxiang781216 merged commit bb14e45 into apache:master Nov 15, 2023
26 checks passed
@jerpelea jerpelea added this to To-Add in Release Notes - 12.4.0 Dec 27, 2023
@jerpelea jerpelea moved this from To-Add to board in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from board to arch in Release Notes - 12.4.0 Jan 8, 2024
@jerpelea jerpelea moved this from arch to processed in Release Notes - 12.4.0 Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

3 participants