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

GeoipCode2 compile error 047: array sizes do not match, or destination array is too small #2037

Open
ambaca opened this issue Aug 5, 2023 · 0 comments

Comments

@ambaca
Copy link
Contributor

ambaca commented Aug 5, 2023

Help us help you

  • [ ✔️ ] I have checked that my issue doesn't exist yet.
  • [ ✔️ ] I have tried my absolute best to reduce the problem-space and have provided the absolute smallest test-case possible.
  • [ ✔️ ] I can always reproduce the issue with the provided description below.

Environment

  • Operating System version: Windows 10 Home
  • Game/AppID (with version if applicable): Counter-Strike: Source (and other games)
  • Current SourceMod version: sourcemod-1.11.0-git6934
  • Current SourceMod snapshot: -
  • Current Metamod: Source snapshot: -
  • [ ❌ ] I have updated SourceMod to the latest version and it still happens.
  • [ ❌ ] I have updated SourceMod to the latest snapshot and it still happens.
  • [ ❌ ] I have updated SourceMM to the latest snapshot and it still happens.

Description

Around two years ago, after GeoIP2 update #1245 functions like GeoipCode2 and GeoipCode3 string output size is restricted to exactly right size. Otherwise you get compile error.

Before GeoIP2 update, you could have give bigger string, but not anymore.

  • Of course, this can be solved to make two string with correct size,( for each GeoipCode2 and GeoipCode3)

Problematic Code (or Steps to Reproduce)

#include <geoip>

public void OnClientPostAdminCheck(int client)
{
  char IP[16];
  GetClientIP(client, IP, sizeof(IP));

  char CODE[4];

  GeoipCode2(IP, CODE); //: error 047: array sizes do not match, or destination array is too small
}

Logs

  • Please attach in separate files: game output, library logs, kernel logs, and any other supporting information.
  • In case of a crash, please attach minidump or dump analyze output.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant