Skip to content

Commit 52d9f5d

Browse files
committed
Merge pull request #64 from ajanicij/master
Fixed a bug: infinite loop in fmq_client.c
2 parents acf6c0e + 7dc12bb commit 52d9f5d

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/fmq_client.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -338,13 +338,21 @@ process_the_patch (client_t *self)
338338
}
339339

340340
sub_t *subscr = (sub_t *) zlist_first (self->subs);
341+
int found = 0;
341342
while (subscr) {
342343
if (!strncmp (filename, subscr->path, strlen (subscr->path))) {
343344
filename += strlen (subscr->path);
344345
zsys_debug ("subscription found for %s", filename);
346+
found = 1;
345347
break;
346348
}
349+
subscr = (sub_t *) zlist_next (self->subs);
347350
}
351+
if (!found) {
352+
zsys_debug ("subscription not found for %s", filename);
353+
return;
354+
}
355+
348356
if ('/' == *filename) filename++;
349357

350358
if (fmq_msg_operation (self->message) == FMQ_MSG_FILE_CREATE) {

0 commit comments

Comments
 (0)