Skip to content

eBPF-based security platform

package: search the probe target only once it is known to be there

Daniel Borkmann9665642c7d28
diff --git a/tools/shirudo-build/package.c b/tools/shirudo-build/package.c
index c8a255a9..4a1a8ded 100644
--- a/tools/shirudo-build/package.c
+++ b/tools/shirudo-build/package.c
@@ -699,12 +699,13 @@ static int split_uprobe_target(const char *src, char **path,
static int split_probe_target(const char *src, char *target,
size_t target_sz, __u64 *offset)
{
- const char *plus = strrchr(src, '+');
+ const char *plus;
size_t len;
*offset = 0;
if (!src || !src[0])
return -EINVAL;
+ plus = strrchr(src, '+');
if (plus) {
const char *num = plus + 1;
size_t n = strlen(num);