Message ID | 20240530150057.444585-8-hadess@hadess.net |
---|---|
State | New |
Headers | show |
Series | Fix a number of static analysis issues #3 | expand |
diff --git a/gobex/gobex.c b/gobex/gobex.c index fdeb11c65130..40d6b8129b00 100644 --- a/gobex/gobex.c +++ b/gobex/gobex.c @@ -1611,7 +1611,7 @@ guint g_obex_setpath(GObex *obex, const char *path, GObexResponseFunc func, memset(&data, 0, sizeof(data)); - if (path != NULL && strncmp("..", path, 2) == 0) { + if (path != NULL && strlen(path) >= 2 && strncmp("..", path, 2) == 0) { data.flags = 0x03; folder = (path[2] == '/') ? &path[3] : NULL; } else {