diff options
Diffstat (limited to 'src/firejail/util.c')
-rw-r--r-- | src/firejail/util.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/firejail/util.c b/src/firejail/util.c index 918077235..a737f9d47 100644 --- a/src/firejail/util.c +++ b/src/firejail/util.c | |||
@@ -1276,14 +1276,13 @@ int has_handler(pid_t pid, int signal) { | |||
1276 | char buf[BUFLEN]; | 1276 | char buf[BUFLEN]; |
1277 | while (fgets(buf, BUFLEN, fp)) { | 1277 | while (fgets(buf, BUFLEN, fp)) { |
1278 | if (strncmp(buf, "SigCgt:", 7) == 0) { | 1278 | if (strncmp(buf, "SigCgt:", 7) == 0) { |
1279 | char *ptr = buf + 7; | ||
1280 | unsigned long long val; | 1279 | unsigned long long val; |
1281 | if (sscanf(ptr, "%llx", &val) != 1) { | 1280 | if (sscanf(buf + 7, "%llx", &val) != 1) { |
1282 | fprintf(stderr, "Error: cannot read /proc file\n"); | 1281 | fprintf(stderr, "Error: cannot read /proc file\n"); |
1283 | exit(1); | 1282 | exit(1); |
1284 | } | 1283 | } |
1285 | val >>= (signal - 1); | 1284 | val >>= (signal - 1); |
1286 | val &= 1; | 1285 | val &= 1ULL; |
1287 | fclose(fp); | 1286 | fclose(fp); |
1288 | return val; // 1 if process has a handler for the signal, else 0 | 1287 | return val; // 1 if process has a handler for the signal, else 0 |
1289 | } | 1288 | } |