Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • G GLib
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 860
    • Issues 860
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 55
    • Merge requests 55
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GNOMEGNOME
  • GLib
  • Issues
  • #2760
Closed
Open
Issue created Sep 20, 2022 by Sophie Brun@sophiebrun

regression since 2.73.2: g_regex_match_simple

Hello,

g_regex_match_simple doesn't work as it used to.

The failures started with version 2.73.2 With 2.73.2 it fails with an error (like mentioned in #2694 (closed))

Since version 2.73.3 there is no error but the regex match does not work. We have identified this issue because we have an issue in gvmd in Kali (https://bugs.kali.org/view.php?id=7926)

It can be easily reproduced with:

#include <stdio.h>
#include <glib.h>

int validate_username (const gchar * name)
{
    if (g_regex_match_simple ("^[[:alnum:]-_.]+$", name, 0, 0))
      return 0;
    else
      return 1;
}

int main() {
    const gchar * username = "admin";
    if (validate_username(username) == 0) {
        printf("OK");
    } else {
        printf("NOT OK");
    }
}

The regex should match with "admin" but it doesn't.

FTR: the tests have been done on Debian with the different versions packaged in Debian.

Assignee
Assign to
Time tracking